How to deploy an assembly without adding a reference to it?

Jan 24, 2012 at 6:51 AM

I'm preparing a package that will include two assemblies: one to be referenced (A) and another to be present in the Bin directory (B) so that (A) can utilize it at runtime.  In other words, it's an implementation detail and needn't be referenced directly by the project.

Does NuGet provide a way to do this?

Jan 25, 2012 at 2:31 AM

Check the nuspec reference, the section that talks about explicitly referencing assemblies

Jan 25, 2012 at 4:10 AM

Thanks, but I've read that page and it doesn't answer my question.  I want to deploy a .dll but not add a reference to it.

Jan 25, 2012 at 1:13 PM

Is it just one assembly you are trying to deploy? I've been able to setup the package for several assemeblies, and I only add references to specific ones, the rest still get to the bin folder even though the project has no references to them directly.

I'm no expert, but maybe with an empty <references></references> tags in nuspec? If not, the only way might be to let nuget add the reference, and with an Install.ps1 script, remove the reference from the project

Jan 25, 2012 at 3:23 PM

There are several packages with slightly different configurations, so let's just say I want to install x assemblies to the project, adding references to y of them, where x >= y.  

Somehow I missed the <references> tag.  I wonder if the phone browser I was using to scan the reference link you sent mis-rendered it because it seems quite obvious now.  

Thanks for your help!

Aug 11, 2014 at 12:14 PM