MSBuild: EmbeddedResource and DependentUpon

S

Stefan Nobis

Hi.

I like nice, cleaned up SolutionExplorer lists, so I like to collect
files that build some kind of a unit together (so in SolutionExplorer
there is one entry with a + sign in front, like for Designer files,
resources etc).

Example: NHibernate needs my-class.hbm.xml mapping files together with
the my-class.cs entity. I want to hide my-class.hbm.xml beneath the
my-class.cs entry (like my-gui.cs and my-gui.Designer.cs).

I tried this:

<EmbeddedResource Include="my-class.hbm.xml">
<DependentUpon>my-class.cs</DependentUpon>
</EmbeddedResource>

That gives me exactly the look&feel I want in SolutionExplorer.

But one problem remains: This DependentUpon seems to change the name
of the embedded resource, so in the compiled assembly the name is no
longer 'my-class.hbm.xml' but just 'my-class' (the content of this
renamed resource is the correct one).

Does anyone know how I could get the result in SolutionExplorer
without the renaming effect of the DependentUpon (because NHibernate
looks only for .hbm.xml resource names in the assembly).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top