Visual Studio refuses to compile my Visual Basic apps

Agent67

Honorary Master
Joined
Nov 7, 2020
Messages
28,008
Reaction score
20,150
Location
Western Cape
So, I'm busy with some Visual Basic work for ICT2611 (UNISA module). But something is happening that's not only grinding my gears but completely imploding my studio...

For some reason, my projects and stuff refuse to compile if I don't keep the name of the .vb file (shown in the red ring in the pic below) strictly as Form1...
adfaf.JPG

It's fine if I rename my form itself and controls on the form, etc, but for some reason, Visual Studio 2022 loses its **** if I rename the .vb file (even tho in the damn prescribed book from Ch. 2 onwards it is always renamed), pic below shows the kind of error I get...
188829


Does anyone know what I can do to stop getting this error?
 
Have you tried switching to C# instead?

Just kidding.
Don't know VB but perhaps there's a reference somewhere in another file that's expecting Form1.vb to be present. Maybe try doing a Find across all files for Form1/Form1.vb and see what's referencing it?
 
Wasn’t reading properly earlier. Go to Debug, Debug properties.
Set it to Launch project and see if that gives the same error.
 
Go to your application properties and check the startup form

View attachment 1469137
YESSSSSSSSSSSSSSSSSSSSSSSSSSSSSS

That worked! I went there and clicked on startup form, there were both an frm123 and Form1 there. Changed to frm123, saved, and ran the program, with no problems. :thumbsup:
Afterwards only frm123 remained in the dropdown, thx bruv!
 
Glad to hear it worked.

Not a massive VB.net fan, but I use it more than I care to admit, I've inherited a lot of VB.net that projects I maintain.
 
Not a massive VB.net fan, but I use it more than I care to admit, I've inherited a lot of VB.net that projects I maintain.
So far VB is nice, it's also quite similar to Delphi in many ways, so that's a plus point to me.
 
Wow I've not heard of VB in years and because I have to do so many things in different languages I never get the time to keep up with e.g the changes in c#
 
I wouldn’t recommend using Visual Studio for Unisa stuff. Rather use the IDE they recommend as your stuff might not work.

Been there, done that. And they won’t try debug it etc if incorrect.
 
I wouldn’t recommend using Visual Studio for Unisa stuff. Rather use the IDE they recommend as your stuff might not work.

Been there, done that. And they won’t try debug it etc if incorrect.
I think netbeans was the last one that they had but being vb, VS makes sense though.
 
I wouldn’t recommend using Visual Studio for Unisa stuff. Rather use the IDE they recommend as your stuff might not work.
The book recommends VS 2017 Community and the module page recommends 2019, but all I could get is VS 2022 Community.
 
Top
Sign up to the MyBroadband newsletter
X