NuGet - choose references to add on install

131 views Asked by At

I want to pack/publish a NuGet package. (private) using a .nuspec file :

\build
    \netstandard1.4
        \MyProject.dll
        \MyProject.Unmanaged.dll
    \net462
        \MyProject.dll
        \MyProject.Unmanaged.dll

In this package, I have a dll that I want to reference in my project, and another that I can't reference, but that is still required.

When I add the package to a project, the dll are automatically referenced, so I get an error : "Failed to add reference to 'MyProject.Unmanaged'. Please make sure that the file is accessible, and that it is a valid assembly or COM component.

Is there a way to choose which dll must be automatically referenced or not ?

1

There are 1 answers

0
user3544117 On BEST ANSWER

See the chapter "Explicit assembly references" : https://learn.microsoft.com/en-us/nuget/schema/nuspec