RIA 服务出现奇怪的错误“代码生成器遇到致命异常”
这是我第二次在 WCF RIA 服务中遇到这个非常奇怪的问题!可悲的是,我必须两次解决这个问题,再次经历不同的麻烦:(,尽管我给自己留了一张纸条指向解决方案:P
无论如何,“非常有用”的错误消息如下:
...\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Ria.Client.targets(304,5):错误:代码生成器“Microsoft.ServiceModel.DomainServices.Tools.CSharpCodeDomClientCodeGenerator”遇到致命异常并且无法为项目“ProjectA”生成代码
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 : The code generator 'Microsoft.ServiceModel.DomainServices.Tools.CSharpCodeDomClientCodeGenerator' encountered a fatal exception and could not generate code for project "ProjectA"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过一番尝试(一段时间)后,我发现了“真正问题”的根源,那就是,我在网络应用程序(主机)中使用了一些资源文件(
.resx
),并链接从我的 silverlight 项目 (ProjectA
) 发送给他们。问题出在生成的资源类的命名空间中。为了解决这个问题,我必须确保对于原始.resx
文件以及链接,以下属性设置正确:这个晦涩的问题很难重现。一旦我解决了它,尝试改变属性并没有把它带回来:
不管怎样,我自己写的注释在这种情况下帮助了我,这就是为什么我希望这篇注释能帮助其他遭受这个问题的人(也许将是未来的我 :P )
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:this obscure problem is hard to reproduce. once I solved it, trying to alter the properties didn't bring it back :s
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 )