简体   繁体   中英

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. I'm reading about Nuget and app.config files here

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

and here

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.

If I install Owin in project C. An app.config file appears in projects A,B,D,F with the following information.

<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. Is there any way to avoid this? Or maybe installing it manually without using nuget?

Thank you.

PS: I'm using VS2015 enterprise

EDIT:

The architecture that we have it's as follow. I Have project WebApi with Owin installed. That project is referenced with the project Connector. That project Connector and all that reference it have the previous app.config file. Is that correct? Why it's necessary if they are not using OWIN?

EDIT2:

I uninstalled all nuget packages from my solution using nuget package manager inside VS2015 and these files with that dependencies are still there.

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

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