Prevent automatic assembly reference for certain assemblies in lib

Sep 28, 2011 at 8:12 PM

I have a solution with about a dozen different assemblies that I'm trying to package with nuget.  Nuget's default behavior seems to be that if you have an assembly in the lib/ folder when you add that package to your project you will end up with a reference to that assembly in that project.  I don't always want this behavior.  There are certain DLLs in my solution that are only appropriate for certain project types.  For example, MyLibrary.TestingSupport should really only be referenced from unit test assemblies.  And MyLibrary.AspNet should only be reference from WebForms projects.

Ideally I would like that most of the DLLs in my package have the default behavior and automatically add the project reference.  But I want some DLLs to not do anything automatically and the consumer would have to manually add references to these "special" assemblies.  Is there any way to achieve this?

Sep 28, 2011 at 10:28 PM
See this - it's up to the package owner to set these up at this time: http://nuget.codeplex.com/workitem/263
By the way, it's new for v1.5, so it may be awhile before package owners are fully aware and compliant. Just use the contact package owner form on nuget.org for the packages in question.

____
Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder


On Wed, Sep 28, 2011 at 4:05 PM, jkohlhepp <notifications@codeplex.com> wrote:

From: jkohlhepp

I have a solution with about a dozen different assemblies that I'm trying to package with nuget. Nuget's default behavior seems to be that if you have an assembly in the lib/ folder when you add that package to your project you will end up with a reference to that assembly in that project. I don't always want this behavior. There are certain DLLs in my solution that are only appropriate for certain project types. For example, MyLibrary.TestingSupport should really only be referenced from unit test assemblies. And MyLibrary.AspNet should only be reference from WebForms projects.

Ideally I would like that most of the DLLs in my package have the default behavior and automatically add the project reference. But I want some DLLs to not do anything automatically and the consumer would have to manually add references to these "special" assemblies. Is there any way to achieve this?

Read the full discussion online.

To add a post to this discussion, reply to this email (nuget@discussions.codeplex.com)

To start a new discussion for this project, email nuget@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com