'tool' package and dependencies

Topics: General
Aug 14, 2013 at 2:26 PM
I've a C# solution with several library projects and, for each, I've created a corresponding '.nuspec' file to automagicaly build packages that I can use in my other projects. It works fine !

Recently I've added a console application to my solution. This one depends on several libraries of the solution and will be used in other projects as a development tool. So I've wanted to build a 'tool' package with the '-Tool' and '-IncludeReferencedProjects' switches but the resulting package doesn't fit my needs :
Only the '.exe' is added to the 'tool' directory of the package and the other libraries are added as package dependency. So, when I install this 'tool' package in another project, I've got error "External packages cannot depend on packages that target projects".

After googling, I've created a dummy content file in the 'tool' package and the package can be installed. Unfortunately the '.exe' can't run because libraries are not placed in the same target directory but are installed as runtime dependency for the project.

Finally, after several attempts, I managed to get the package I wanted renaming '.nuspec' files of referenced projects so that nuget doesn't detect them during packing.

Is there a way to do this automaticaly or should I play with msbuid targets ?