原貼地址點擊打開鏈接
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即可