7 Replies
What's your .NET version?
Double-check that
Seems like it might be complaining about file-scoped namespaces
It's Framework 4.8, yeah
It won't support file-scoped namespaces
(and most modern features)
Is the code you have there, all you have?
If so, editing the
.csproj file should be enough to update it
Close VS, open the .csproj file with Notepad or something, change the target framework version to net7 for example
Assuming you use Visual Studio 2022, since 2019 supports only versions up to .NET 5
Weird... Where did you get the screenshot from, then?
uhCode works perfectly fine for me, as-is

Close VS, and open it by double-clicking on the project file?
What's that
accessibility.dll you speak of?
That's where the old .NET Framework that comes with Windows is installed
huh
Open command prompt or Powershell or something in your project directory, and run dotnet run, see if that works
Like in the screenshot I senti ma be honest, your defining usertime after the string usertime = console.readline
Nothing of the sort is happening
It's
usertime, then it's usertimesoh
oh
ok
very sorry
wtf
dotnet --version?
No clue what's going on
One random guess would be that it's somehow because the project is located on the desktop...?
Out of curiosity, still using the CLI, create a project on a different drive and try to run it
kinda deal
Use a different drive as I said
Not the system drive
Nice, so it works when on a different drive!
Open this project now, and paste your code
Nice
The error certainly doesn't sound like it was
But it might've been, idk
Sometimes the issue is some weird system protection on the system drive
Or OneDrive indexing the desktop to back it up
So, all in all, it's best to have your projects on a non-system drive, and use Github for backups lol