NuGet does not treat '*.resources.dll' as an assembly reference

Nov 23 2011 at 12:46 PM

This post is simply intended to turn up in someone's future search to help diagnose an 'issue' caused by an undocumented feature of NuGet.

We have a set of common libraries that we used across our apps and one of the dlls was called "Common.Resources.dll". Note that this isn't a localization assembly (which get named 'MyAssembly.resources.dll). We packaged this up and the .nuspec inside the package had the requisite <file src="lib\net35\Common.Resources.dll" target="lib\net35\Common.Resources.dll" />. However, when installing the package, we noticed that a reference to this dll was never added.

It turns out the NuGet deliberately does not add references to any dlls that end with '.resources.dll', presumably on the assumption that it's a localization assembly. On the whole this is a sensible thing, but unfortunately in this case it silently excluded our assembly. The real cause of the problem here was our dodgy assembly name, but it would be nice if this particular feature was documented (I had to debug this to discover the issue).

I hope this helps someone in future!

Developer
Nov 23 2011 at 2:08 PM

Thanks for sharing your finding. Yes, we didn't do a good job of documenting all of our features, especially corner cases like this.

Btw, did you know that you can contribute to writing our docs site too? If you are keen to adding this information to the docs site, here's the page that can get you started http://docs.nuget.org/docs/Contribute/Contributing-to-NuGet-Documentation