设为首页 - 加入收藏 ASP站长网(Aspzz.Cn)- 科技、建站、经验、云计算、5G、大数据,站长网!
热搜: 数据 创业者 手机
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

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

发布时间:2020-12-25 09:28 所属栏目:34 来源:网络整理
导读:我刚刚将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开始了解程序集重新存储

(编辑:ASP站长网)

    网友评论
    推荐文章
      热点阅读