views:

279

answers:

2

I am using

<ItemGroup>
  <EmbeddedResource Include="..\..\resources\hbm\*.hbm.xml" />
</ItemGroup>

to include a bunch of xml files into my C# project. Works fine.

But, I don't want them in the "root level" of my project, I would rather see them in a subfolder in my project.

For example, this file is included into a Mapping folder in Visual Studio:

<ItemGroup>
  <EmbeddedResource Include="Mapping\User.hbm.xml" />
</ItemGroup>

That's what I want for my *.hbm.xml files.

I can't figure out how to do it and still keep my wildcard *.hbm.xml part and also keep the actual files in a different directory.

I've looked at MSDN's doc on MSBUILD and items, but no luck.

+1  A: 

I think you can't use links and wildcard at the same time.

You could use this notation to link to include User.hbm.xml file in Mapping folder in Visual Studio :

<ItemGroup>
  <EmbeddedResource Include="..\..\resources\hbm\User.hbm.xml">
    <Link>Mapping\User.hbm.xml</Link>
  </EmbeddedResource>
</ItemGroup>

But you can't do that

<ItemGroup>
  <EmbeddedResource Include="..\..\resources\hbm\**\*.hbm.xml">
    <Link>%(RecursiveDir)\%(Filename)%(Extension)</Link>
  </EmbeddedResource>
</ItemGroup>
madgnome
I decided to just write a script that updates my CSPROJ file. I added it as an Exec task in my msbuild script. Works fine, but is a bit icky.
quip
A: 

Can one use wildcard patterns for vcproj files?

abellina