Reputation: 4193
We've recently upgraded from VS2008 to VS2010. The conversion of our vb.net Windows Forms app went well, but we're now having big problems with the forms designer.
Pretty much any change to the layout of a form (sometimes just a solution rebuild) will work once, but on recompile, the IDE designer refuses to display the form, the error message being a null-reference exception (with no details as to what).
Closing and restarting VS2010 will cure it, but only for one compile cycle - and it's obviously not practical to close and reopen every time. Closing and reopening the form does not fix it.
We had these very occasionally before, if there was something wrong in the form's load event, or more rarely for random reasons, but since VS2008 SP1 this was never serious.
Whereas now with VS2010, it's now every form, every compile.
It's completely unworkable, and we've had to revert to VS2008 for winforms dev.
Any suggestions would be greatly appreciated..
Upvotes: 0
Views: 3623
Reputation: 11
we faced the same problem. The reason ist, that the Handles statements are not converted according the control name, but in capital letters.
However the controls themselves still contians the original correct name in lower case or mixed. They also do this way in the designer.vb code. You have to correct alle handles in the .vb code to match the name in the designer.vb code of the same form.
A (fast) workaround is as follow. a) Load the defective project. b) Try to open a form c) Press F7 to open the code d) Replace all Handles to 'handles (search and replace, it works only form by form this way) e) start a build f) replace all 'handles to Handles g) now the form should open
Unfortunately this works only form by form as VS 2010 'chockes' loading too many forms at a time.
We are not taking any responsibility for the functionality not for eventual damage of your code using this suggestion!
Upvotes: 1
Reputation: 8773
Is your project Targets to .Net Framework 4 Client Profile
or .Net Framework 4
?
If you are not intentionally targeting to .Net Framework 4 Client Profile
then change it to .Net Framework 4
you have a fair enough chance.
If, that was not helpful. Please do the above procedure as ChrisW said. That is the last option.
Upvotes: 1
Reputation: 56113
You can debug design mode:
devenv.exe
.You may find more detailed information on the 'net, by Googling for 'debug design mode'.
Upvotes: 3