简体   繁体   中英

Nuget Install-Package successful but no reference added to csproj

I've got a bunch of projects in the same solution, which have project dependencies all correctly set between them (when nedded, obviously). There is one project whose DLL has no dependencies to any other project of the same solution (let's name it My_First_Dll.dll ). I created Nuget packages for all DLLs successfuly.

Now when I go into package manager console in my test project where I want to add certain references created from the first solution, for example My_Dependent_Dll , I type Install-Package MyNamespace.My_Dependent_Dll . Nuget says it gets the DLL, and I can see it in the packages folder created on my solution folder, in the packages.config file created in my solution, in the references list of the project and even editing the csproj I can see the reference with hintpath. So everything's fine for My_Dependent_dll .

Problem : My_First_Dll.dll , which is referenced by My_Dependent_dll , according to the nuget output, is successfuly installed as well (as it should, bc it is referenced by My_Dependent_Dll ), and the dll actually is downloaded to the packages folder and added to the packages.config. BUT My_First_Dll is not added to the references in the solution explorer, and is completly missing from the csproj. So it "doesn't exist" for Visual Studio.

None of the questions here helped me.

[SOLVED]

Apparently nuget doesn't like dlls ending in .resources.dll . And guess what? My non_dependent_DLL had exactly that ending.

Reference:

on https://docs.nuget.org/create/nuspec-reference

NuGet does not add references to any dlls that end with '.resources.dll'

which lead me to the explanation in the following link

http://nuget.codeplex.com/discussions/280566

Hope it helps anyone with this problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM