Using C# 6.0 (.NET 4.7.1)?

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

Using C# 6.0 (.NET 4.7.1)?

Post by DFIronman »

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: 7236
Joined: Sun Mar 22, 2015 1:51 am

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

Post by Interkarma »

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: 111
Joined: Sun Nov 10, 2019 8:01 pm

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

Post by DigitalMonk »

Off topic, but I had to respond to:
Interkarma wrote: Sun Dec 22, 2019 4:06 amlinear 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 »

Certainly not off topic.

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

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

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

Post by JorisVanEijden »

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: 7236
Joined: Sun Mar 22, 2015 1:51 am

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

Post by Interkarma »

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: 17
Joined: Mon Dec 10, 2018 12:00 am

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

Post by hurleybird »

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 »

Good news guys, Unity 2019LTS is here :)

https://unity.com/releases/2019-lts

EDIT:

Added 1. attempt at upgrading to Unity 2019.4.01f LTS

https://github.com/GalacticChimp/dagger ... -4-0f1-lts

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

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

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

Post by agamer »

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
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

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

Post by Interkarma »

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

https://github.com/Interkarma/daggerfal ... 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