I had this cool idea. What if I could hide my NHibernate Entity.hbm.xml files behind their respective c# files in the Solution Explorer. This would tidy things up a bit as I’m getting a bit overloaded in my project at work.
It turns out that this is pretty easy to accomplish… visually. Here’s what we’re trying to accomplish:
Busting out the .csproj file I can edit the file to go from:
<EmbeddedResource Include="Class1.hbm.xml" />
I even found a macro that does it for you rather than having to hack the visual studio project file directly.
Unfortunately it suddenly broke all my unit tests. Turns out that when adding “dependent upon” it does more than just the visual but actually changes the name (and type?) of the file. Here’s what it looks like in Reflector before:
Anyone have any ideas on how to solve this?