微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

nuget – 为什么在安装autofac时我的所有web.configs都使用程序集重定向进行更新?

我刚刚将autofac安装到我的一个项目中,称之为项目A,在我使用nuget的解决方案中.出于某种原因,我的所有web.config文件,我在解决方案中有多个Web应用程序和api,使用像这样的程序集重定向更新:
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
        </dependentAssembly>
    </assemblyBinding>
</runtime>

这意味着程序集重定向是什么意思?解决方案如何知道所有这些web.config文件需要更新?是因为我的Web应用程序引用了项目A吗?

解决方法

这与Autofac无关,因为它是nuget功能

nuget-1.2 release notes:

Automatically Add Binding Redirects

When installing a package with
strong named assemblies,NuGet can Now detect cases where the project
requires binding redirects to be added to the configuration file in
order for the project to compile and add them automatically.

您可以在发行说明:NuGet versioning Part 3: unification via binding redirects中提到的文章中阅读有关为什么需要组装redersicts的更多信息

通常可以从MSDN:Redirecting Assembly Versions开始了解程序集重新存储

原文地址:https://www.jb51.cc/html/227771.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐