【问题标题】:Getting aspnet_merge error after converting VS 2008 project to VS 2010将 VS 2008 项目转换为 VS 2010 后出现 aspnet_merge 错误
【发布时间】:2012-08-22 16:38:36
【问题描述】:

我收到一个错误

"aspnet_merge: error 1023: The assemblies cannot be merged because some assemblies have inconsistent attributes: System.Runtime.CompilerServices.ExtensionAttribute. Use -a option to force merge. Use -allowattrs to specify the attributes to skip when checking for consistency."

合并程序集时。

我之前所做的,只需在我的 VS 2010 中打开 VS 2008 解决方案而不更改 .Net Framework(当 VS 2010 提示我将 .Net Framework 更改为 4.0 时选择否)并通过更改 NewtonSoft dll 解决此错误**missing compiler required member System.Runtime. CompilerServices. ExtensionAttribute..ctor**从 2.0 到 3.5 的版本。

现在成功发布我的项目后,我必须合并 dll,但我遇到了上述错误。我已经检查了不同版本的 aspnet_merge (3.5/4.0),但得到了相同的错误。

请让我知道为此需要做什么。

【问题讨论】:

    标签: visual-studio-2010 visual-studio-2008 dll .net-assembly aspnet-merge


    【解决方案1】:

    这是因为项目没有引用 Microsoft.CSharp。一旦我添加了对该程序集的引用,它就编译得很好。

    如果问题仍然存在,请尝试重新安装JSON.Net

    PM> Install-Package Newtonsoft.Json -Version x.x.x.x
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-16
      • 1970-01-01
      • 2011-03-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多