4

I'm getting the following error now when I build my Silverlight Business Application:

The code generator

'Microsoft.ServiceModel.DomainServices.Tools.CSharpCodeDomClientCodeGenerator' encountered a fatal exception and could not generate code for project

'C:\Software\ProjectPartCenterAdmin\Alpha\Latest Version\ProjectPartCenterAdmin\ProjectPartCenterAdmin.csproj':

Exception has been thrown by the target of an invocation.

I DID ABSOLUTELY NOTHING TO MY CODE since it last worked! All I did was a clean rebuild of the application. Is there a way to get the details on what the exception was? I am dead in the water until i can figure this out.

Oh, and by the way, I hate code generation! I've had endless problems with RIA Services and I'm trying my best to do things "the right way"; that is, no hacks.

Edit:

I've also been getting a similar warning:

The following exception occurred creating the MEF composition container:

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

The default code generator will be used.

I've been getting this for some time now, and have ignored it because the application seems to be working fine.

Also, when I remove my CustomValidation attributes the exception goes away. But the warnings do not.

Jordan
  • 9,642
  • 10
  • 71
  • 141
  • 1
    Same problem. Didn't touch my code and this started happening. Did you resolve? – Ronnie Overby Jul 03 '11 at 19:26
  • If your building inside VS it tends to swallow a lot of build errors. Try building it on the command line – Chris Haines Jul 24 '11 at 21:12
  • @Ronnie, No, this remains unresolved. I worked around it by rebuilding my project from scratch, about an hour of work. :( I know that it has something to do with generated code (obviously), and I think its a RIA services thing because I don't think the DBML designer uses `CodeDom`. Those two are the only extensive code generators that I'm using. – Jordan Jul 25 '11 at 13:57
  • 1
    One thing you might try, it's resolved issues for me in the past. If you have mutiple projects in your solutiomn (like a typical Web project + Silverlight project) - set another project as the startup project, rebuild, then set it back to the previous project. Sounds strange, but this has worked for me. – Joel Tipke Aug 17 '11 at 02:23
  • Interesting, I'll give it a try next time it happens. – Jordan Aug 17 '11 at 13:59

1 Answers1

1

First, you need to check if there were custom validation errors in the project. I had the same issue but when I realized that I had two validation result methods with the same name! and change it, the built was successfull.

Miguel Becerra
  • 111
  • 1
  • 4