简体   繁体   中英

VS2012 VB.NET Designer Errors

I was commenting out code in my project and starting getting errors in the designer which stopped me from viewing the page.

After this i decided to put everything back so I was able to run the program again. (Yes, i have made sure to comment everything back)

I am now getting designer errors on some of my pages. Here is the errors and examples.

Here is the list of errors I am getting:

http://i.stack.imgur.com/NFX8G.png

The application does run but if i click on the frmMediaDevices1.vb page this is the errors that then appears:

http://i.stack.imgur.com/XZrPE.png

I think it maybe something to do with the Windows.Media.Player that i have referenced in the project on frmMain.vb as when I click the errors the designer code appears highlighting my media player on the page.

Does anyone know how I can maybe refresh the designer? Or know how i can fix this issue?

Form's class must be the first in the form's class module.

Problem you described happens if you have files like

Form1.designer.vb
Form1.vb
Form1.resx

and into file Form1.vb which contains Class Form1 you add class Class Helper1 . You can do it, but class Form1 must be kept as the first class (tompost in code) in Form1.vb .

Of course, this also includes the case if you have only one (proper) class in the file ( Class Form1 ), but you comment it out.

Just be careful with your commenting and you will avoid that error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM