Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuget Package without Package.Config?

I encountered a solution (.Net Full framework) Where there are no package.config in the solution and Feeds coming from In house Nuget servers.

Where list of packages are maintained, if not in Package.Config?

like image 438
Abhijeet Avatar asked Mar 21 '18 13:03

Abhijeet


People also ask

Is NuGet config necessary?

If you're trying to create a NuGet package from your own code, you do not need a NuGet. config file. The NuGet. config file exists to specify package sources from which packages are installed and updated - i.e. where you consume packages from.

Where is NuGet packages config?

If used, packages. 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 .

Should packages config be checked in?

Yes the packages. config file is required. This file holds the packages you reference and the versions youre using. NuGet uses this file to restore your packages in a TFS build of on the machine of another developer.


1 Answers

Where is the list of packages are maintained, if not in Package.Config?

First, you should make sure you have that solution have already installed the nuget package, once you install a package, NuGet will add Package.Config file to your project to record the dependency in either your project file or a packages.config file.

If you confirm that your solution has a nuget package installed, but there is no Package.Config file, your nuget package should use another management method: PackageReference

Edit your project, you will find following PackageReference list:

<ItemGroup>
    <PackageReference Include="Contoso.Utility.UsefulStuff" Version="3.6.0" />
</ItemGroup>

See NuGet is now fully integrated into MSBuild for more details:

In the past, NuGet packages were managed in two different ways - packages.config and project.json - each with their own sets of advantages and limitations. With Visual Studio 2017 and .NET Core, we have improved the NuGet package management experience by introducing the PackageReference feature in MSBuild. PackageReference brings new and improved capabilities such as deep MSBuild integration, improved performance for everyday tasks such as install and restore, multi-targeting and more.

like image 94
Leo Liu-MSFT Avatar answered Sep 29 '22 22:09

Leo Liu-MSFT