C
C#13mo 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
Angius13mo 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
LordoToastyOP13mo ago
No description
LordoToasty
LordoToastyOP13mo ago
I've done it, tho it still gives me the same error
Angius
Angius13mo ago
What's minecraftServerJarUri?
LordoToasty
LordoToastyOP13mo ago
Its the minecraftServerJarUrl, a string but coverted into a URI.
LordoToasty
LordoToastyOP13mo ago
here's the code.
Angius
Angius13mo ago
Just make it static then Instead of re-instantiating the Program
LordoToasty
LordoToastyOP13mo 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