Nuget在多个项目中创建app.config文件

时间:2016-05-19 09:29:51

标签: c# nuget owin

我开始在我的解决方案中使用Nuget在某些项目中安装Owin和其他一些依赖项。我在这里阅读Nuget和app.config文件

Why NuGet adds app.config with assemblyBinding to LIBRARY projects during a NuGet package update?

在这里

https://msdn.microsoft.com/en-us/library/7wd6ex19.aspx

现在我知道他们为什么使用它们,绑定特定版本等等......

我遇到的问题是,我有32个项目的大解决方案。

如果我在项目C中安装Owin。项目A,B,D,F中会出现app.config文件,其中包含以下信息。

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
          <assemblyIdentity name="Microsoft.Owin" 
              publicKeyToken="31bf3856ad364e35" culture="neutral" />
          <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
      </dependentAssembly>
    </assemblyBinding>
</runtime>

为什么我得到这个?这些项目没有使用OWIN。有什么方法可以避免这种情况吗?或者可以手动安装它而不使用nuget?

谢谢。

P.S:我正在使用VS2015企业

编辑:

我们拥有它的架构如下。我安装了Owin的项目WebApi。项目连接器引用该项目。该项目连接器以及引用它的所有内容都具有以前的app.config文件。那是对的吗?如果他们不使用OWIN,为什么还需要?

EDIT2:

我使用VS2015中的nuget包管理器从我的解决方案中卸载了所有nuget包,这些依赖的文件仍在那里。

1 个答案:

答案 0 :(得分:2)

我建议信任NuGet并保留app.config更改(khellang explained why), 但如果真的让你烦恼,你可以skip applying binding redirects