加入收藏 | 设为首页 | 会员中心 | 我要投稿 衡阳站长网 (https://www.0734zz.cn/)- 数据集成、设备管理、备份、数据加密、智能搜索!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

nuget – 为什么在安装autofac时我的所有web.configs都使用程序

发布时间:2020-12-26 17:20:29 所属栏目:资源 来源:网络整理
导读:我刚刚将autofac安装到我的一个项目中,称之为项目A,在我使用nuget的解决方案中.出于某种原因,我的所有web.config文件,我在解决方案中有多个Web应用程序和api,使用像这样的程序集重定向更新: runtime assemblyBinding xmlns="urn:schemas-microsoft-com:asm.

我刚刚将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开始了解程序集重新存储

(编辑:衡阳站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读