C
C#2mo ago
'brella boy

my program won't run in vs 2022, but it runs in an online compiler

can someone help me figure out what is wrong?
19 Replies
Marvin
Marvin2mo ago
you would need to provide the error messages, and relevant code if its a compilation error of specific code passages
'brella boy
'brella boy2mo ago
will do
'brella boy
'brella boy2mo ago
No description
'brella boy
'brella boy2mo ago
No description
'brella boy
'brella boy2mo ago
exact same code in another compiler
No description
Kiel
Kiel2mo ago
if you double click on the error it should take you to the exact line it's reporting the error on, or should at least state it - where exactly is it saying the error is occurring?
'brella boy
'brella boy2mo ago
it says line 5
'brella boy
'brella boy2mo ago
No description
'brella boy
'brella boy2mo ago
bbut idk whats wrong with it
Kiel
Kiel2mo ago
you could try $vsdrunk and see if that resolves the issue, my only other guess is that you haven't defined a namespace but I don't think that would cause an error as there's already clearly a warning/hint instead
MODiX
MODiX2mo ago
* close VS * remove the hidden folder .vs * remove all bin and obj folder next to each csproj (DO NOT TOUCH THE .git FOLDER OR WHAT'S INSIDE) * restart vs
Marvin
Marvin2mo ago
also if you copied the code from a web editor, try remove that { and write it manually again
'brella boy
'brella boy2mo ago
I didn't I wrote it myself? I have no clue what that is.. oh nvm wait the hidden folder ??
Kiel
Kiel2mo ago
You might have to enable showing hidden files Not at my PC so can't post a screenshot sorry
'brella boy
'brella boy2mo ago
ah ill try
Kiel
Kiel2mo ago
this is where it is on my PC if you're on windows 11 it might be different
No description
Mayor McCheese
Mayor McCheese2mo ago
I think you're confusing the top level statements compilation, without the namespace it's expecting statements before classes, if you wrap in a namespace does the problem disappear?
'brella boy
'brella boy2mo ago
oh sorry for disappearing but I just ended up deleting vscode because i literally have 0 idea how it works and cant come here every time i have a small issue with the program and not even my own code
Mayor McCheese
Mayor McCheese2mo ago
Giving up is a sound strategy
Want results from more Discord servers?
Add your server