Microsoft Visual Studio Community 2022 (64-bit)
Windows 11
Sometimes when I’m working, Visual Studio (I presume that is what is doing it) will “seize” for a short period after which some of the controls that have been working perfectly become unrecognizable to the compiler. I have found the resolution, I just don’t understand why it happens and how I might prevent it.
Something is causing IMPORTs statements to be added to the list at the top of my form/class. These always seem to be at the end of the list and I finally figured out I could just comment them out or delete them and everything goes back to normal.
The IMPORTs statements are not always referencing the same namespace. I only know now to look here because I’ve spent the time lumbering through online documentation, object browser, etc.
I have an example right now I’m trying to figure out in one of my classes.
“DoEvents” is not a member of “Application”
This is an odd one and I know that DoEvents is not a recommended event call. More often it is that ‘treeview’ is not recognized as an object, or something very similar. This one is the one I’m dealing with and led me to finally ask the world about.
This is NOT an urgent problem. I can get past my current issue by just removing these calls in the class having the problem but the calls are NOT causing issues in quite a few of my other classes in the same project.
In the class where it is failing, I have the following IMPORTS
Imports System.IO
Imports System.Reflection.MethodBase
Imports System.Windows
In one of the ones that does not have the issue, I have the following imports:
Imports System.Security.Cryptography
Imports System.Text
Neither of these imports lists was changed (by me) any time recently and I’m not sure either has changed at all from when they were created.
I am primarily interested in WHAT is causing this. I’m happy to figure out what happened or what I must do to fix it on my own. I would really like to know what I’m doing that is causing it.
Thank you for any insight you can provide.
e.g.bell
Post Script:
I resolved the problem by removing the
Imports System.Windows
statement from the list in the offending class. I should have tried that before I posted this long question, but it would still leave me without an understanding of WHY it happens, so I would still appreciate any help anyone can provide.
Thx
1