【问题标题】:Consider app.config remapping of assembly with no app.config mapping考虑在没有 app.config 映射的情况下对程序集进行 app.config 重新映射
【发布时间】:2018-01-08 16:36:19
【问题描述】:

如何确定在何处修复此引用而不向 app.config 添加绑定?

Consider app.config remapping of assembly "System.Runtime.Serialization.Primitives, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.1.1.0" [] to Version "4.1.2.0" [F:\Production\packages\System.Runtime.Serialization.Primitives.4.3.0\lib\net46\System.Runtime.Serialization.Primitives.dll] to solve conflict and get rid of warning. 12>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file:

【问题讨论】:

    标签: .net visual-studio nuget assemblies


    【解决方案1】:

    我在升级 Microsoft 标识包(通过 NuGet)时开始收到错误消息。 web.config 文件的<runtime> 节点中的某些版本号未更新。我按照 Leo Liu-MSFT 的说明(上图)找到了这个修复程序。

    【讨论】:

      【解决方案2】:

      真正的问题是 .csproj 文件中的引用在进行 nuget 更新时没有更新,因此警告在 app.config 中覆盖这些引用。如果您更新 .csproj,所有警告都会消失。

      【讨论】:

      • 我在 web.config 中也有一个重复的 NewtonSoft.Json。我手动删除了过时的条目。我认为此命令将避免错误:将 NewtonSoft 更新到所需版本(例如,8.0.0 到 11.0.2),将项目更新到 .net 框架的较新版本(例如,4.5.1 到 4.7.2)。
      【解决方案3】:

      我通过针对更高版本的 .Net Framework 解决了这个问题。从 4.7 切换到 4.7.2,警告消失了。从 EF6 切换到 EF.Core 后警告开始

      【讨论】:

        【解决方案4】:

        如何确定在何处修复此引用而不向 app.config 添加绑定?

        您可以尝试将“MSBuild 项目构建输出详细程度”更改为“详细”或以上以查看详细错误日志。为此,请通过工具 -> 选项...->项目和解决方案->构建和运行。将 MSBuild 项目构建输出详细级别 设置为 Detailed 或更高。构建项目并在输出窗口中检查错误日志。 ResolveAssemblyReferences 任务是 MSB3247 的起源任务,应该可以帮助您调试此特定问题。

        然后转到旧版本的项目,删除引用,然后添加正确的引用。

        【讨论】:

          猜你喜欢
          • 2011-12-18
          • 2013-06-01
          • 2013-10-10
          • 2014-06-06
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2014-04-09
          • 2011-06-14
          相关资源
          最近更新 更多