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