RIA服务的“奇怪的错误”代码生成器遇到致命异常“ [英] weird error with RIA Services "code generator encoutered a fatal exception"
问题描述
这是第二次,我有这个真正奇怪的问题,WCF RIA服务!可悲的是,我不得不解决这个问题两次,经历不同的循环:(即使我已经留下一个注释给自己指向解决方案:P
This is the second time that I have this really weird problem with WCF RIA Services! the sad thing is that I had to solve the problem twice, going through the different hoops again :(, even though I've left a note to myself pointing to the solution :P
无论如何,非常有用的错误信息如下:
Anyways, the "pretty useful" error message is the following:
... \MSBuild\Microsoft\Silverlight \v4.0\Microsoft.Ria.Client.targets(304,5):error:代码生成器Microsoft.ServiceModel.DomainServices.Tools.CSharpCodeDomClientCodeGenerator遇到致命异常,无法为项目ProjectA生成代码
...\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Ria.Client.targets(304,5): error : The code generator 'Microsoft.ServiceModel.DomainServices.Tools.CSharpCodeDomClientCodeGenerator' encountered a fatal exception and could not generate code for project "ProjectA"
推荐答案
在一段时间后,我发现问题,这是我在web应用程序(主机)中使用一些资源文件( .resx
),并从我的silverlight项目链接到它们( ProjectA
)。问题出现在生成的资源类的命名空间中。为了解决这个问题,我必须确保对于原始的 .resx
文件以及链接,以下属性设置正确:
after toying around (for a while), I found the source of the "real problem" which was that, I was using some resource files (.resx
) in the web application (host), and linked to them from my silverlight project (ProjectA
). The issue was in the namespace of the generated resource classes. To solve this issue, I had to make sure that, for the original .resx
files as well as the links, the following properties are set correctly:
"Custom Tool" is set to PublicResXFileCodeGenerator
"Custom Tool Namespace" is set to the same namespace ("ProjectA.Web.Resources" in my case)
b $ b
这个模糊的问题很难重现。一旦我解决了,试图改变属性没有带回:
this obscure problem is hard to reproduce. once I solved it, trying to alter the properties didn't bring it back :s
反正,我写的自己的说明帮助我在这种情况下,这就是为什么我希望这个注释将帮助那里的人遇到这个问题(也许这将是我的未来:P)
anyways, the note I wrote myself helped me in this situation, that's why I hope this note would help somebody else out there suffering from this issue (maybe that would be future me :P )
这篇关于RIA服务的“奇怪的错误”代码生成器遇到致命异常“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!