Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing packages.config file

I'm trying to do something with .NET core in VS2017 RC, but I noticed the packages.config is missing, because they default in defining dependency in the project file. However my configuration look like this: enter image description here so apparently it should use the file. Apparently it does not honour that configuration. Furthermore, Is there some reason we should prefer the dependency in the project file anyway?

like image 895
Felice Pollano Avatar asked Feb 17 '17 08:02

Felice Pollano


People also ask

Where can I find packages config file?

config must be located in a project root. It's automatically created when the first NuGet operation is run, but can also be created manually before running any commands such as nuget restore . Projects that use PackageReference do not use packages. config .

How do I fix a missing NuGet package?

Enable package restore by choosing Tools > Options > NuGet Package Manager. Under Package Restore options, select Allow NuGet to download missing packages. In Solution Explorer, right click the solution and select Restore NuGet Packages.

Does .NET core use packages config?

NET Core always uses the package reference.


1 Answers

In previous versions of .net the csproj contained an assembly reference to a DLL that was stored inside a package. However that was treated seperately, from the packages.config which declared the packages to restore into the packages directory.

In dotnet core, packages are declared inside of the csproj file, as "PackageReference" The overall idea of a packages.config does not exist in dotnet core, which is why visual studio is not trying to create one for you. If you were using the old project system, you will find a packages.config is created for you.

like image 154
TerribleDev Avatar answered Oct 07 '22 06:10

TerribleDev