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: 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?
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 .
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.
NET Core always uses the package reference.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With