WCF RIA 问题. 编译时 CreateRiaClientFilesTask 失败
2011-11-25 10:31
465 查看
The"CreateRiaClientFilesTask" task failed unexpectedly
System.IO.FileLoadException:Loading this assembly would produce a different grant set from other instances.(Exception from HRESULT: 0x80131401)
这是WCF RIA中的一个BUG,常见于在服务器端使用了泛型类
原因:
The problem willoccur when marshaling an object by value between two appdomains in the sameprocess wherethetype of the instance is generic, the generic template type isdefined in mscorlib, one or more of its instantiating types is not defined
inmscorlib and multi-domain loader optimization has been enabled in one domainbut not the other.
Unfortunately thisbug was discovered too late and didn't make the bar for the V2.0 product. Thereare some workarounds however:This bug is specific to an optimized version ofthe in-process, cross-appdomain remoting channel。
【http://connect.microsoft.com/VisualStudio/feedback/details/95157/loaderoptimization-multidomain-incompatible-with-generics】
解决方式:
方式1.修改注册表:
HKEY_CURRENT_USER\Software\Microsoft\.NETFramework\UseNewCrossDomainRemotingregistry value (a DWORD) to 0 (or the version in HKEY_LOCAL_MACHINE)
方式2.在WCFRIA服务器端Project设置:
set complus_UseNewCrossDomainRemoting=0
System.IO.FileLoadException:Loading this assembly would produce a different grant set from other instances.(Exception from HRESULT: 0x80131401)
这是WCF RIA中的一个BUG,常见于在服务器端使用了泛型类
原因:
The problem willoccur when marshaling an object by value between two appdomains in the sameprocess wherethetype of the instance is generic, the generic template type isdefined in mscorlib, one or more of its instantiating types is not defined
inmscorlib and multi-domain loader optimization has been enabled in one domainbut not the other.
Unfortunately thisbug was discovered too late and didn't make the bar for the V2.0 product. Thereare some workarounds however:This bug is specific to an optimized version ofthe in-process, cross-appdomain remoting channel。
【http://connect.microsoft.com/VisualStudio/feedback/details/95157/loaderoptimization-multidomain-incompatible-with-generics】
解决方式:
方式1.修改注册表:
HKEY_CURRENT_USER\Software\Microsoft\.NETFramework\UseNewCrossDomainRemotingregistry value (a DWORD) to 0 (or the version in HKEY_LOCAL_MACHINE)
方式2.在WCFRIA服务器端Project设置:
set complus_UseNewCrossDomainRemoting=0
相关文章推荐
- Silverlight编译问题:未给任务“CreateRiaClientFilesTask”的必需参数“ClientFrameworkPath”赋值。
- 当机器蓝屏后,vs编译提示“CreateRiaClientFilesTask”任务意外失败的解决办法!silverlight4.0
- CreateRiaClientFilesTask”任务意外失败。System.Web.HttpException (0x80004005): 未能加载文件或程序集
- “CreateRiaClientFilesTask”任务意外失败。 未能加载文件程序集“System.ComponentModel.DataAnnotations 处理办法
- win8.1 Silverlight4编译出错: 未给任务“CreateRiaClientFilesTask”的必需参数“ClientFrameworkPath”赋值
- Silverlight编译出错: 未给任务“CreateRiaClientFilesTask”的必需参数“ClientFrameworkPath”赋值
- “CreateRiaClientFilesTask”任务意外失败。 未能加载文件程序集“System.ComponentModel.DataAnnot...
- WCF “GenerateWcfClientFilesTask”任务意外失败
- 未给任务“CreateRiaClientFilesTask”的必需参数“ClientFrameworkPath”赋值
- 未给任务“CreateRiaClientFilesTask”的必需参数“ClientFrameworkPath”赋值解决方法
- FtpClient中文文件名下载失败问题
- 关于“cvPyrSegmentation”找不到标识符和与之相关的编译失败的问题
- maven分布式开发解决编译失败问题
- C-Free 5.0编译失败问题解决办法
- gradle 编译失败,出现 permgen space的问题
- 使用静态库编译程序失败的问题
- @Override造成编译失败的问题
- WCF Ria Service“操作失败,指定的命名链接在配置中找不到”错误解决方法
- Apache的FTPClient.listFiles()返回空问题讨论解决
- [转载] 同一client并发connect同一server超时失败问题