自從使用Visual Studio 2012 RC後,我們在剃鬚刀視圖中使用便攜式類庫(.net 4.5 & metro配置文件)中的類時遇到了HttpCompileException。使用Visual Studio 2012 RC的MVC 4/Razor中的可移植類庫?
例外:(德語到英語翻譯對谷歌,對不起)
System.Web.HttpCompileException (0x80004005):
c:\Users\user\AppData\Local\Temp\Temporary ASP.NET
Files\root\1995167a\126b7c4d\App_Web_index.cshtml.1fbcdbb1.zaniprm5.0.cs(29):
error CS0012: The type 'System.Object' is not in a referenced assembly is
defined. Add a reference to the Assembly "System.Runtime, Version = 4.0.0.0,
Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a" added.
at
System.Web.Compilation.AssemblyBuilder.Compile()
System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
...
解決方案結構:
- 移植類庫(.NET 4.5 &地鐵輪廓)
- 公共類用戶{...}
- MVC 4(.NET 4.5)
- 參考移植類庫
- 剃刀視圖
- @model用戶
由於的Visual Studio 2012 RC添加參考「系統。運行時間「是不可能的。
作爲一種解決方法,除了.NET 4.5和Metro風格之外,是否還可以將可移植類庫更改爲定位Silverlight 5? –