将VS 2008项目转换为VS 2010后出现aspnet_merge错误

时间:2012-08-28 07:35:26

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

我收到错误

"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时选择否)并通过更改解决此错误**missing compiler required member System.Runtime. CompilerServices. ExtensionAttribute..ctor** NewtonSoft dll版本从2.0到3.5。

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

请让我知道需要做些什么。

1 个答案:

答案 0 :(得分:0)

这是因为项目未引用Microsoft.CSharp。一旦添加了对该程序集的引用,它就可以很好地编译了。

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

PM> Install-Package Newtonsoft.Json -Version x.x.x.x
相关问题