Jump to content
  • 0

Oxide Plugin Compiler - Language Level


Question

Posted

So being rather new to C#, I was wondering why my plugins wouldn't compile on the server. Then I discovered Rider was by default set to C# 9.0, while the compiler used on the server compiles for C# 6.0. Is there any way to upgrade the compiler?

5 answers to this question

Recommended Posts

  • 0
Posted
15 minutes ago, Raul-Sorin Sorban said:

You can most likely compile oxide on your own using the repository and changing the targeting platform to C# 9.0, but that's not something that's enabled by default by Oxide itself, so most servers would use the C# 6.0 version whenever they install Oxide on their servers.

https://github.com/OxideMod/Oxide.CSharp/blob/develop/src/ObjectStream/Data/CompilerLanguageVersion.cs

I found out about this, tried changing it, building a new DLL and upload that. Then restarted my server. However it didn't do anything.

In the meantime I also did some research. Apparently Facepunch uses Unity 2019 LTS, which supports up to C# 7.3. Not sure if that applies to server and client, but I assume it does. If my assumption is correct, the server won't be able to run newer code anyway, would it? (https://docs.unity3d.com/2019.4/Documentation/Manual/CSharpCompiler.html)

If it was trivial to change, I would guess somebody would've already done it, or it would be done by default. Quite sure Wulf/Luke knows what he's doing, so there is probably a good reason why it's still compiling with target of C# 6.0. I did send him a message about it on uMod's website, however yet to hear back from him.

  • 0
  • Administrator
Posted
5 hours ago, Nozemi said:

So being rather new to C#, I was wondering why my plugins wouldn't compile on the server. Then I discovered Rider was by default set to C# 9.0, while the compiler used on the server compiles for C# 6.0. Is there any way to upgrade the compiler?

Nope

  • 0
Posted
6 hours ago, Raul-Sorin Sorban said:

Nope

What do you mean nope? You've tried and haven't found a way? Or you know that there is a limitation somewhere? I'm curious to know why this is the case, because without knowing a lot about Oxide or Rust, the ones I've asked (who are experienced programmers) have had any reasonable explanation for it. Most people tell me there must be a way 😛

  • 0
  • Administrator
Posted
1 hour ago, Nozemi said:

What do you mean nope? You've tried and haven't found a way? Or you know that there is a limitation somewhere? I'm curious to know why this is the case, because without knowing a lot about Oxide or Rust, the ones I've asked (who are experienced programmers) have had any reasonable explanation for it. Most people tell me there must be a way 😛

You can most likely compile oxide on your own using the repository and changing the targeting platform to C# 9.0, but that's not something that's enabled by default by Oxide itself, so most servers would use the C# 6.0 version whenever they install Oxide on their servers.

  • 0
Posted (edited)
17 hours ago, bmgjet said:

Yes you can recompile it to newer version,
But should you? No all its going to do is cause issues with older plugins.

FacePunch updated to unity 2021 not long ago.

Not really worried about breaking other plugins. I make my own plugins or fix the broken ones. So if that’s the only problem, I’d like to go with newer language level.

Edited by Nozemi

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
1.5m

Downloads

Total number of downloads.

7k

Customers

Total customers served.

105.2k

Files Sold

Total number of files sold.

2.1m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.