1

我們在Windows應用程序項目中存在自定義用戶控件的問題。 我們使用visual studio 2010(c#)。 當我們打開,其包括一個自定義的控制形式的設計圖,設計視圖顯示以下錯誤: http://i.imgur.com/Li9qC.jpgvs2010 windows應用程序設計時錯誤

形式屬於ui.forms而定製控制屬於ui.controls。

這個錯誤突然出現,即使我們恢復到較舊的版本,它仍然會出現。

如果我們點擊「忽略並繼續」,第一個錯誤不會導致任何問題,但控件「specializzazioni1」不會再出現在表單中。無論如何,在執行時,它看起來是正確的。

+0

卸載/重新加載項目瀏覽器中的項目。它應該消失 – AbiusX

回答

0

通常當你在VS設計器中遇到像這樣的錯誤時,這是​​因爲在你的用戶控件\ form的構造函數中拋出了一個異常 - 所以我會檢查那裏是怎麼回事。也許你正在做一些初始化錯誤?

3

以下時間有助於捕捉設計時間錯誤。 Reference

1) Start a second instance of visual studio

2) go the the Tools menu, "Attach to process", select the 'devenv.exe' process, and click the 'attach' button.

3) In the Debug/Exceptions menu, enter image description here Turn on exception catching when first thrown (in the Debug->Exceptions menu).

4) Open the designer with the debugger attached.

5) The second visual studion will break on your error.

+1

非常有幫助,謝謝! – mcanti