C
C#7mo ago
LordoToasty

I have a Visual-Studio Proj. in .NET Framework and need help fixing the "CS0120" error it throws up.

Basically I want to make an App which you just run and it will automatically, by pressing just one button, create and set up a Minecraft server, for that I had to convert a string in to Uri, I had problems with it but I was able to fix it at last, tho right after that it started to punch me down with a CS0120 error which I couldn't resolve.
9 Replies
Angius
Angius7mo ago
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs0120 If you want to use a non-static method of a class, you need an instance of that class
LordoToasty
LordoToasty7mo ago
No description
LordoToasty
LordoToasty7mo ago
I've done it, tho it still gives me the same error
Angius
Angius7mo ago
What's minecraftServerJarUri?
LordoToasty
LordoToasty7mo ago
Its the minecraftServerJarUrl, a string but coverted into a URI.
LordoToasty
LordoToasty7mo ago
here's the code.
Angius
Angius7mo ago
Just make it static then Instead of re-instantiating the Program
LordoToasty
LordoToasty7mo ago
It worked, THANKS! Didn't thimk it would be that simple, and I destroyed my head cus of that XD.
Want results from more Discord servers?
Add your server
More Posts