开发者

Unhandled Exception when adding Usercontrol - Silverlight 4.0

I keep getting

Unhandled Exception when adding Usercontrol - Silverlight 4.0

every time I add the selected bit of Xaml to the UserControl

Could it be that I cannot add a UserControl within a UserControl?

Bigger开发者_高级运维 image is at http://i53.tinypic.com/2ekupo0.png


Adding a something derived from a UserControl to a UserControl is fine.

However in order to render in the designer some of the code in the UserControl you are adding will execute. The most common cause for this problem is code that doesn't take into account that it may not be running as part of the target app but in VS2010 process instead.

If your control is simple and the code isn't causing the problem I'd be inclined to remove that underscore you have in its name. Have look through the .NET framework and even third-party libraries, how many classes do you spot that have underscores in the name? Not strictly illegal but anything off norm ought to be avoided f possible.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜