VS/NuGet 如何决定创建 csproj 引用,差异意味着什么? [英] How does VS/NuGet decide to create csproj references and what do the differences mean?

查看:49
本文介绍了VS/NuGet 如何决定创建 csproj 引用,差异意味着什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我安装 NuGet 包时,它通常会使用新的引用更新我的 proj 文件,如下所示:

When I install a NuGet package, it typically updates my proj file with a new reference like so:

<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>

这有两个部分,每个部分有时都没有添加:

There are two parts of this each of which sometimes are not added:

, Version=4.5.0.0...

 <SpecificVersion>False</SpecificVersion> <!-- sometimes this is present but set to true -->

这些设置中的每一个都有什么影响,NuGet 如何在安装/更新包时选择要指定的组合?

What implications do each of these settings have and how does NuGet choose which combination to specify when installing/updating a package?

推荐答案

别担心这个.我唯一一次冒险进入 csproj 是在我一直在做一些绳索代码时将构建视图设置为 true.如果你没有问题,那就没问题了.具体的版本和版本号是 .net 中 dll 地狱黑暗时期的残余,我们在 GAC 中有多个版本的 Dll.我唯一注意到它们的时候是在我引用一些 COM 可见程序集时.

Don't worry about this. The only time I ever venture into the csproj is to set build views to true when I have been doing some ropey code. If you are having no issues it's fine. The specific version and version numbers are a remnant from dark times of dll hell in .net where we had multiple versions of Dll's in the GAC. The only time I notice them is when I reference some COM visible assembly.

这篇关于VS/NuGet 如何决定创建 csproj 引用,差异意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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