Answer the question
In order to leave comments, you need to log in
Why aren't NuGet dependencies loaded into code?
Hello!
Such a problem: packages.config contains all the necessary dependencies, as well as in the packages folder, the NuGet Package Manager shows the installed packages for the solution, i.e., everything has been downloaded and installed. But only these libraries are not loaded in the code - 14 thousand errors like "are you missing a using directive or an assembly reference?". What could I have missed?
Perhaps I made a completely stupid mistake somewhere, please don’t blame me, I’m trying to run a real project on .NET for the first time, before that I only worked with Java.
UPD: Visual Studio 2015, NuGet 3.3.0.167
Answer the question
In order to leave comments, you need to log in
1) check if nuget restore is running. Just open the packages yourself, go to the folders of specific packages and check that the downloaded assemblies are there
2) unfortunately, in classic C# projects (not DNX), interaction with NuGet is rather mediocre. In the sense that the contents of the project and packages.config may be out of sync (due to the lack of a single list of packages / assemblies, as was done in project.json). Those. everything will be in packages.config, but these links will not be written in csproj.
The way out of the situation is to open the csproj handles and put the necessary References by writing relative paths to the assemblies in packages, like these:
<Reference Include="NetTopologySuite.IO.ShapeFile">
<HintPath>..\..\packages\NetTopologySuite.IO.1.13.3.2\lib\net40-client\NetTopologySuite.IO.ShapeFile.dll</HintPath>
</Reference>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question