C
C#4mo ago
rigamortus

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
Marvin4mo ago
you would need to provide the error messages, and relevant code if its a compilation error of specific code passages
rigamortus
rigamortusOP4mo ago
will do
rigamortus
rigamortusOP4mo ago
No description
rigamortus
rigamortusOP4mo ago
No description
rigamortus
rigamortusOP4mo ago
exact same code in another compiler
No description
Kiel
Kiel4mo 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?
rigamortus
rigamortusOP4mo ago
it says line 5
rigamortus
rigamortusOP4mo ago
No description
rigamortus
rigamortusOP4mo ago
bbut idk whats wrong with it
Kiel
Kiel4mo 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
MODiX4mo 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
Marvin4mo ago
also if you copied the code from a web editor, try remove that { and write it manually again
rigamortus
rigamortusOP4mo ago
I didn't I wrote it myself? I have no clue what that is.. oh nvm wait the hidden folder ??
Kiel
Kiel4mo ago
You might have to enable showing hidden files Not at my PC so can't post a screenshot sorry
rigamortus
rigamortusOP4mo ago
ah ill try
Kiel
Kiel4mo ago
this is where it is on my PC if you're on windows 11 it might be different
No description
Mayor McCheese
Mayor McCheese4mo 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?
rigamortus
rigamortusOP4mo 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 McCheese4mo ago
Giving up is a sound strategy
Want results from more Discord servers?
Add your server