简体   繁体   中英

Nuget: What is the purpose of the <package requireReinstallation /> attribute in packages.config?

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" />

From therelease 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM