How can I get details about a Silverlight code generation exception?

余生长醉 提交于 2019-12-07 09:04:35

问题


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.


回答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.



来源:https://stackoverflow.com/questions/5329052/how-can-i-get-details-about-a-silverlight-code-generation-exception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!