SampSharp icon indicating copy to clipboard operation
SampSharp copied to clipboard

What would it take to update to a newer .NET version?

Open markski1 opened this issue 1 year ago • 16 comments

Hello, my question is basically the title. Imagine I wanted to update SampSharp for targetting .NET 8, what would need to be changed? Would it require a rewrite of the library or minor things?

It catches my eye that the default Project package targets .NET Core 3.1, despite this library not seeming abandoned, so I was wondering how viable would it be to try and bring it up to date

markski1 avatar Aug 01 '24 18:08 markski1

Well SampSharp on main branch is targeting net 6 and the nuget package from what i see is net standard 2.1 But i do see the template for creating the project is targeting an older version.

Basically it takes nothing apart from updating to the latest nuget package of SampSharp and changing your project to target a newer net version, no need to change anything for it to work

CiprianN23 avatar Aug 01 '24 18:08 CiprianN23

Hi Ciprian, thanks for the quick answer!

I haven't tried this yet because I don't have a Linux machine available, but theoretically, if I targetted .NET 8, and put the x32 Linux runtime of .NET 8 in my "runtime" folder for my samp server, would it then run just fine on .NET 8?

markski1 avatar Aug 01 '24 18:08 markski1

Yes, it will just be fine

CiprianN23 avatar Aug 01 '24 18:08 CiprianN23

SampSharp is supporting .NET 8 , i test it and it's working

LYZENCORE-9 avatar Aug 01 '24 19:08 LYZENCORE-9

Many thanks

markski1 avatar Aug 02 '24 23:08 markski1

SampSharp is supporting .NET 8 , i test it and it's working

Sorry to bring this up again, but may I ask, where did you find an x86 build of .NET 8? Seems the official download is only x64

markski1 avatar Aug 04 '24 00:08 markski1

SampSharp is supporting .NET 8 , i test it and it's working

Sorry to bring this up again, but may I ask, where did you find an x86 build of .NET 8? Seems the official download is only x64

go to this repository [https://github.com/Servarr/dotnet-linux-x86](NET 8 x86_64 Linux Unofficial Build)

LYZENCORE-9 avatar Aug 04 '24 14:08 LYZENCORE-9

Very nice, thanks once again.

markski1 avatar Aug 04 '24 19:08 markski1

@LYZENCORE-9 @markski1 I can't run dotnet linux x86 for .net 8 (https://github.com/Servarr/dotnet-linux-x86/releases/tag/v8.0.4-90). I'm testing it on a VPS with ubuntu 20.04 but it does not run gamemode:

image

As shown in the image, it keeps initializing the runtime and from there it does nothing, the server never starts. Do you know what it could be?

DevD4v3 avatar Oct 24 '24 21:10 DevD4v3

@MrDave1999 I ran into the same problem and sadly did not have enough free time to troubleshoot it. It seems to balloon in commit memory size until it crashes out. Very strange

markski1 avatar Oct 24 '24 22:10 markski1

Yes, that's the problem: https://github.com/Servarr/dotnet-linux-x86/pull/5#issuecomment-1968268268

DevD4v3 avatar Oct 24 '24 23:10 DevD4v3

@LYZENCORE-9 @markski1 I can't run dotnet linux x86 for .net 8 (https://github.com/Servarr/dotnet-linux-x86/releases/tag/v8.0.4-90). I'm testing it on a VPS with ubuntu 20.04 but it does not run gamemode:

image

As shown in the image, it keeps initializing the runtime and from there it does nothing, the server never starts. Do you know what it could be?

weird , i use this runtimes in my server at my home and it works

LYZENCORE-9 avatar Oct 27 '24 18:10 LYZENCORE-9

Also running into this issue where it is initializing the runtime, consumes all memory briefly and then kills the process. Any known solutions would be greatly appreciated!

KoertLichtendonk avatar Dec 23 '24 21:12 KoertLichtendonk

@KoertLichtendonk I have not found any solution. The only thing we could do is to manually compile the runtime .net 8.0 for an x86 machine. For now I am running my server with this runtime: https://github.com/Servarr/dotnet-linux-x86/releases/tag/v6.0.35-97

DevD4v3 avatar Dec 23 '24 21:12 DevD4v3

Based on my recent experiences, using updated versions of .NET is only possible on Windows servers. Servers running Linux unfortunately still need to use .NET 6 with the https://github.com/Servarr/dotnet-linux-x86/releases/tag/v6.0.35-97 runtime.

I think the one way to solve this problem once and for all would be to use Open.mp in 64 bits and use .NET x64. I don't know if this is possible yet, but I see that finding a .NET 8 x86 runtime that works would only be a pothole filler because we would have the problem happening with each new .NET version, so we would always need a compilation of the working x86 runtime.

Yes, this is very boring, Microsoft unfortunately does not support 32-bit Linux so we will not have x86 being provided by them officially.

Duduzera1997 avatar Dec 24 '24 18:12 Duduzera1997

@Duduzera1997 @MrDave1999 after i finish from some works and some tests from my academy , i will recompile all .NET 8 runtimes for 32-bit linux target (x86)

LYZENCORE-9 avatar Dec 26 '24 12:12 LYZENCORE-9