Using C# 6.0 (.NET 4.7.1)?

Discuss coding questions, pull requests, and implementation details.
Post Reply
DFIronman
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
Interkarma
Posts: 5476
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
DigitalMonk
Posts: 83
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

Image

Jeoshua
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
1fe6451a0fd38f463a06c8404ac00f80--happy-birthday-memes-christmas-meme.jpg (16.76 KiB) Viewed 383 times

User avatar
JorisVanEijden
Posts: 100
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 (https://unity3d.com/unity/qa/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.

4. YOLO
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
Interkarma
Posts: 5476
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.

hurleybird
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.

Post Reply