简体   繁体   English

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

[英]Nuget creates app.config files in multiple projects

I'm starting to use Nuget in my solution to install Owin and some other dependencies in certain projects. 我开始在我的解决方案中使用Nuget在某些项目中安装Owin和其他一些依赖项。 I'm reading about Nuget and app.config files here 我在这里阅读有关Nuget和app.config文件的内容

Why NuGet adds app.config with assemblyBinding to LIBRARY projects during a NuGet package update? 为什么NuGet在NuGet包更新期间将app.config与assemblyBinding一起添加到LIBRARY项目?

and here 和这里

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

Now I know why are they used, binding specific versions and so on... 现在我知道为什么使用它们,绑定特定版本等等......

The problem that I'm having is that ie I have a big solution with 32 projects. 我遇到的问题是,我有32个项目的大解决方案。

If I install Owin in project C. An app.config file appears in projects A,B,D,F with the following information. 如果我在项目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>

Why I'm getting this? 为什么我得到这个? These projects are not using OWIN. 这些项目没有使用OWIN。 Is there any way to avoid this? 有什么方法可以避免这种情况吗? Or maybe installing it manually without using nuget? 或者可以手动安装它而不使用nuget?

Thank you. 谢谢。

PS: I'm using VS2015 enterprise PS:我正在使用VS2015企业

EDIT: 编辑:

The architecture that we have it's as follow. 我们拥有的架构如下。 I Have project WebApi with Owin installed. 我安装了Owin的项目WebApi。 That project is referenced with the project Connector. 项目连接器引用该项目。 That project Connector and all that reference it have the previous app.config file. 该项目连接器以及引用它的所有内容都具有以前的app.config文件。 Is that correct? 那是对的吗? Why it's necessary if they are not using OWIN? 如果他们不使用OWIN,为什么还有必要?

EDIT2: EDIT2:

I uninstalled all nuget packages from my solution using nuget package manager inside VS2015 and these files with that dependencies are still there. 我使用VS2015内部的nuget包管理器从我的解决方案中卸载了所有nuget包,这些带有依赖关系的文件仍然存在。

我建议信任NuGet并保留它所做的app.config更改( khellang解释了原因 ),但如果真的让你烦恼,你可以跳过应用绑定重定向

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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