Using C# 6.0 (.NET 4.7.1)?

Discuss coding questions, pull requests, and implementation details.
Posts: 68
Joined: Sat Aug 24, 2019 12:48 am

Using C# 6.0 (.NET 4.7.1)?

Post by DFIronman » Thu Dec 19, 2019 11:04 pm

Hey, I'd like to be able to use some of the later features of C#, but it seems like anything added beyond C# 4.0 won't compile. Am I doing something wrong with my installation or is this intentional?

C# 6.0 has apparently been available in Unity since 2018.1, so it should be usable unless there's a reason why the DFU package hasn't been modified to allow for the use of it?

User avatar
Posts: 5560
Joined: Sun Mar 22, 2015 1:51 am

Re: Using C# 6.0 (.NET 4.7.1)?

Post by Interkarma » Sun Dec 22, 2019 4:06 am

I'd say we can uptick this when moving to Unity 2019.x and linear lighting. That's a change I was looking at for December, but have moved this and a few other things I've been working on to 2020 so I had more time for reviewing PR backlog.

User avatar
Posts: 91
Joined: Sun Nov 10, 2019 8:01 pm

Re: Using C# 6.0 (.NET 4.7.1)?

Post by DigitalMonk » Mon Dec 23, 2019 7:33 pm

Off topic, but I had to respond to:
Interkarma wrote:
Sun Dec 22, 2019 4:06 am
linear lighting


Posts: 153
Joined: Tue Nov 26, 2019 7:25 am

Re: Using C# 6.0 (.NET 4.7.1)?

Post by Jeoshua » Tue Dec 24, 2019 6:02 pm

Certainly not off topic.

Upgrades. Yaaaas.
1fe6451a0fd38f463a06c8404ac00f80--happy-birthday-memes-christmas-meme.jpg (16.76 KiB) Viewed 630 times

User avatar
Posts: 101
Joined: Mon Aug 12, 2019 5:02 pm

Re: Using C# 6.0 (.NET 4.7.1)?

Post by JorisVanEijden » Thu Feb 20, 2020 9:33 am

May I suggest choosing one of these options:

1. Only use LTS releases (
LTS releases keep getting bugfixes far longer than other releases.
2017.4 (an LTS release) is currently still getting bugfixes, long after they stopped for 2018.2 (non-LTS)
In fact I've been having a lot of debugger crashes in 2018.2 that have apparently been long solved in 2017.4 and 2018.4.

2. Follow one behind.
When a new minor release is done the previous one will usually only get one or two updates after that.
So going to 2019.2 when 2019.3 is released gives you time while unity fixes the fallout of the changes they made. Then by the time they release 2019.4 the 2019.3 version should be stable enough to upgrade to.

3. Conservative
Follow one LTS release behind. When a new LTS version is released you ugrade to the previous LTS version.

Just upgrade to anything anytime. For those that are in love with the unity support forums ;)

Okay, I'm not really suggesting choosing option 3 or 4 ;)

User avatar
Posts: 5560
Joined: Sun Mar 22, 2015 1:51 am

Re: Using C# 6.0 (.NET 4.7.1)?

Post by Interkarma » Thu Feb 20, 2020 8:30 pm

I'm now waiting for 2019.4 LTS to drop before moving over. This will be the final engine upgrade for the foreseeable future, other than 2019.4.x point releases.

Posts: 12
Joined: Mon Dec 10, 2018 12:00 am

Re: Using C# 6.0 (.NET 4.7.1)?

Post by hurleybird » Sun Mar 22, 2020 12:46 am

1 and 3 make the most sense imho, possibly with more rapid progression when new useful language features come online. In a lot of scenarios you can write far nicer code in C# 7.3 (the current supported version) than you can in 4.0. The sooner you upgrade in this context, the less you need to refactor in the future.

For myself, I'm not nearly so sensible because I have a compulsive need to have all the newest stuff. I update to the latest Unity version pretty frequently for my own project, but do a bit of a sniff test beforehand to see how many issues people are having. So I'm still on 2019.2, but I'll probably move to 2019.3 within the next three or four point releases.

User avatar
Galactic Chimp
Posts: 16
Joined: Wed Apr 29, 2020 10:25 pm

Re: Using C# 6.0 (.NET 4.7.1)?

Post by Galactic Chimp » Tue Jun 09, 2020 5:38 pm

Good news guys, Unity 2019LTS is here :)


Added 1. attempt at upgrading to Unity 2019.4.01f LTS ... -4-0f1-lts

It almost works, apart from some problems in DaggerfallFont.cs and TextMeshPro

Posts: 8
Joined: Sat Jul 06, 2019 2:29 am

Re: Using C# 6.0 (.NET 4.7.1)?

Post by agamer » Sat Jun 20, 2020 5:52 am

I don't have 2019.4 downloaded yet but I remember encountering similar issues with font and textmesh pro in other non standard builds. I think I recall solving the font issue by redirecting into local streamingassets folder, that was one font issue, then the other was redirecting to another font. For textmesh pro, I think I dropped down to version 1.3.0 using package manager. Just thought I'd add those suggestions in case you didn't try them.

User avatar
Posts: 5560
Joined: Sun Mar 22, 2015 1:51 am

Re: Using C# 6.0 (.NET 4.7.1)?

Post by Interkarma » Sat Jun 20, 2020 11:34 pm

The 2019.x upgrade changes have been solved for a while. See minimum changes in my test branch here. ... c906a81b26

This upgrade surprisingly introduces no known issues to mods. Now that 2019.4 is out, I'll work this upgrade into release cycle. Some of the other pending changes post 2019.4 such as C#, .NET, and Linear lighting will happen later.

Post Reply