I upgraded my C# project (which already had some nuget packages) from 4.0 to 4.5.2. I saw that some <package />
elements now contain an additional attribute requireReinstallation="true"
.
What is the purpose of this?
Why is that some packages have while others don't.
Before
<package id="NLog" version="3.1.0.0" targetFramework="net40" />
After
<package id="NLog" version="3.1.0.0" targetFramework="net40" requireReinstallation="true" />
The packages. config file is used in some project types to maintain the list of packages referenced by the project. This allows NuGet to easily restore the project's dependencies when the project is to be transported to a different machine, such as a build server, without all those packages.
NuGet is a package manager that delivers compiled source code (DLLs) and other files (scripts and images) related to code. A NuGet package takes the form of a zip file with the extension . nupkg. This makes adding, updating, and removing libraries easy in Visual Studio applications.
If you right click the project in question you can select "Manage nuGet Packages" from the menu. After you do that you can click "installed packages" on the left hand side to see the packages that you currently have installed. These are what you are seeing in your "packages. config" file.
packages. config: The targetframework attribute of a dependency specifies the variant of a package to install.
From the release notes
If we detect that any of your packages were affected by the retargeting or upgrade, we’ll produce immediate build errors to let you know. In addition to the immediate build error, we also persist a requireReinstallation="true" flag in your packages.config file for all packages that were affected by the retargeting, and each subsequent build in Visual Studio will raise a build warnings for those packages.
Essentially, NuGeT is automatically flagging packages which conflict with your project target or version
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