Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
405 views
in Technique[技术] by (71.8m points)

c# 4.0 - System.ComponentModel.Design.ExceptionCollection

I'm using the Ribbon control located on CodePlex, and following the tutorial located here . Once I add the reference, and the proper code in the designer I get this error when I try to view the form:

Exception of type 'System.ComponentModel.Design.ExceptionCollection' was thrown

And I cant figure out what I'm doing wrong. Anyone worked with this control and know how to resolve this issue?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Interesting; I just ran into this same issue with one of my own forms; which is how I found your relevant and recent question.

Here's how I solved it:

  1. Open two instances of Visual Studio. Open the same project in both.
  2. In one instance, goto Debug->Exceptions and enable all the 'Thrown' options to stop at first chance exceptions. This will stop the debugger when the exception is generated.
  3. In the same instance, select Debug->Attach to Process, select devenv.exe.
  4. In the other instance, open the form to cause the exception
  5. With any luck the first instance should stop somewhere that yields a more relevant exception.

In my case it turned out to be something that I should have conditioned with:

if (!DesignMode)
{
  // Do something that should only happen at runtime
}

Don't forget turn turn off all those 'Thrown' options later.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...