10

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"

Spontifixus
  • 6,570
  • 9
  • 45
  • 63
AbdouMoumen
  • 3,814
  • 1
  • 19
  • 28

1 Answers1

5

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)

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 )

AbdouMoumen
  • 3,814
  • 1
  • 19
  • 28
  • Sadly it doesn't solve the issue I'm experiencing with this. I'm pretty sure I have a similar problem, but adding these settings to the resource files does not work in my case. – Willem Meints Apr 18 '11 at 09:36
  • yeah, this issue is kind of obscure. you can see that the cause of the problem is something very unlikely to have anything to do with the symptom. my advice, try to trace back your steps and figure out what did you do that could have triggered this. – AbdouMoumen Apr 18 '11 at 12:36