Search Unity

C# 7.3 features

Discussion in 'Scripting' started by vitautart, Jan 14, 2019.

  1. vitautart

    vitautart

    Joined:
    May 3, 2018
    Posts:
    29
    According to this https://blogs.unity3d.com/ru/2018/12/13/introducing-unity-2018-3/
    Now we can use c#7.3 features, I'm on 2018.3.0f2, and my visual studio says that I cannot use "unmanaged" please use language 7.3 or greater.

    My project was on 2018.2 long time, then I upgrade to 2018.3 release, how can I turn on 7.3 features?
     
  2. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    2,712
    Make sure you've got enabled .Net 4.x in player settings;

    If you do, then you need to setup the VS to support the target above C#.
    (No idea how to do it in VS, in Rider it's just alt -> enter -> Use C# X version for project).

    So google might be your best bet.
     
  3. vitautart

    vitautart

    Joined:
    May 3, 2018
    Posts:
    29
    Thanks for reply.
    Yes I have enabled this option in player settings.

    The problem with setup VS, that I can do that also, as you described, and for some time it works, but when I restart my project, unity whipe out this settings from projects, and c#7.3 features doesnt work again. I try also edit project settings by hand in project-name.csproj and in Assembly-CSharp-Editor.csproj to alow 7.3, but that's also doesn't work.

    P.S. Anyway "unmanaged" constrain not so usefull for me as I expected, so for now sitting on C#7.0 not so critical for me.
     
unityunity