nuget and lib\NETXX lib\slXX directory structure

Topics: General
Mar 17, 2013 at 8:52 AM
Hi,

In order to pack all needed packages of a customer I have wrote a script that walks over all csproj files, find references and packs them to .nupkg file. Each DLL in a different package (it is too much to write in order to explain that).
I couldn't use the .csproj file as it'll pack the project's output DLL and I wanted to pack the project's "input" references.
Doing that, I have found out that I need a certain directory structure in order to succeed. The directory structure is as follows:
x.nuspec (conf file)
lib (folder)
--- NETXX (folder)
 --- files to pack
Now, when I tried to install a package that has been packed in the following directory structure into a silverLight project, it failed although the DLL that is packed inside this package can be added as a reference into a silverLight project without any issues.
I have found out that only if I use the following directory structure, I can install that same DLL into a SL project:
x.nuspec (conf file)
lib (folder)
--- SLXX (folder)
 --- files to pack
Why is that so? Now I need to duplicate all my packages.

Thanks
Gil
Mar 18, 2013 at 5:47 PM
When you put assembly into a NETXX folder, you indicate that this assembly can only be installed into a .net project.

If you have assembly that can be installed into both .net and silverlight projects, you can add them into a portable library folder.
Mar 19, 2013 at 9:52 AM
Hi dotnetjunky,

Thanks for the answer.
We have tried to create a package only with the lib folder. We got the following warning message:
__WARNING: 1 issue(s) found with package '<package ID>'.

Issue: Assembly not inside a framework folder.
Description: The assembly 'lib\<DLL name>' is placed directly under 'lib' folder. It is recommended that assemblies be placed inside a framework-s
pecific folder.
Solution: Move it into a framework-specific folder. If this assembly is targeted for multiple frameworks, ignore this warning.__

but the package did create and when I have tried to install in the SL project, it worked.

What am I missing?

Thanks
Gil
Mar 19, 2013 at 3:27 PM
Don't worry about the warning. It's harmless.
Mar 21, 2013 at 8:15 AM
Thanks