IIS7 web app error : "Could not load type 'System.Security.Claims.ClaimsIdentity' from assembly

原贴地址点击打开链接

The problem was that I even though had <compilation  targetFramework="4.0"> in the web.config, that's not enough. The web service was already compiled with 4.5 as the target (in the Visual Studio project properties) so references to ClaimsIdentiy was embedded in the dll that was produced by the build.

I tried to simply change the project property setting from 4.5 to 4.0 and recompiling but that gave be a world of other errors. I ended up creating a new VS solution and added the code back in and targetted 4.0 from the start. That let me deploy without this error (however I'm now stuck on the next error but think its unrelated to this one).

出现的原因是netFramework版本不符,创建的程序是用的4.5,使用程序的是4.0. 编者解决的办法是重新创建一个VS解决方案把代码重新拷贝进去,然后重新用4.0版本生成。

通常是用VS高版本如2012,编写的程序代码,在VS10中运行不了,看网上还有人说开发的应用程序重新用VS2012 的net framework4.0生成


相关问题可以参考以下

http://blog.csdn.net/findstr/article/details/8772372 


VS2010打开VS2012或者13的方法

http://www.cnblogs.com/johnsony/p/Version2012To2010.html

1、在sln解决方案中出现Visual Studio 2012的地方 改为2010

2、所有的工程文件.csproj中<TargetFrameWorkVersion> 版本号<TargetFrameWorkVersion> ,将版本号改为VS2010可以识别的4.0

3、删除工程文件中<import  project=“$........\Microsoft.Common.props”/>这一行

4、config文件中也有Framework更改,改为4.0即可


发布了27 篇原创文章 · 获赞 7 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/xiaoxiang22/article/details/51154652
今日推荐