سؤال

I have been developing a windows form based project in visual basic .NET, moving the code between several computers simply by copying the solution folder. This has never caused any problems in the past, however my current project seems to have stopped generating valid code in the designer.

Whenever I modify a form in the form designer it changes all type names to their fully qualified names (e.g. Form becomes System.Windows.Forms.Form). This would normally be fine, except the designer seems to have forgotten what System, System.Windows or System.Windows.Forms are, as well as System.Drawing. I have checked that all of these are in the projects reference list, and all the paths refer to valid .dlls.

Currently to work on this project I must go into the designer code and do a replace-all on "System.Windows.Forms" and "System.Drawing" with empty space after every change to the forms. This is messy, and my next solution is to simply remake the forms in a new project and copy the code over on the assumption some obscure solution configuration is broken.

Does anybody have any experience with this?

هل كانت مفيدة؟

المحلول

Did you name one of your classes or types "System"?

نصائح أخرى

This issue can be caused by an erroneous work of an add-in installed in the VS. Despite I am working with VS very intensively, I haven't seen this effect. This is the only idea which came to my mind ...

If you would like to, you can re-do almost every line of the designer code in your vb code, for example, in the Form1 class. But you do not want to modify the Designer.vb. Even if you can, and it works, if you later change anything in the Form, VS re-writes every line of the file, and your work will be ignored.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top