Nuget:<package requireReinstallation/> 的目的是什么?属性在packages.config? [英] Nuget: What is the purpose of the &lt;package requireReinstallation /&gt; attribute in packages.config?

查看:80
本文介绍了Nuget:<package requireReinstallation/> 的目的是什么?属性在packages.config?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我的 C# 项目(已经有一些 nuget 包)从 4.0 升级到 4.5.2.我看到一些 元素现在包含一个附加属性 requireReinstallation=true".

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.

之前

<package id="NLog" version="3.1.0.0" targetFramework="net40" />

之后

<package id="NLog" version="3.1.0.0" targetFramework="net40" requireReinstallation="true" />

推荐答案

来自发行说明

如果我们检测到您的任何软件包受到重定向或升级的影响,我们将立即生成构建错误以通知您.除了立即生成错误之外,我们还在您的packages.config 文件中为所有受重定向影响的包保留一个requireReinstallation="true" 标志,并且Visual Studio 中的每个后续生成都会为这些包引发生成警告.

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.

本质上,NuGeT 会自动标记与您的项目目标或版本冲突的包

Essentially, NuGeT is automatically flagging packages which conflict with your project target or version

这篇关于Nuget:<package requireReinstallation/> 的目的是什么?属性在packages.config?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆