0

Scripting in VS 2015 for Unity 5.5.2 project, needing to upgrade to C# v.6+ I have VS community 2015 version 14 update 3. I am working in Unity 5.5.2 and trying to learn the game engine. I am trying to create some scripts which opens up into VS. Upon trying to add default initializers for properties of my class it gives an error. For some reason the program loads using C# version 4. I would like to upgrade this to version 6, but when I have read other solutions to change the C# version it has always been going to the projects property page.

Snesh Prajapati's example doesn't work as the property page didn't have those options.

After trying David De Sloovere's solution some reason (maybe being a Unity project) the screen just flashes and no page is loaded when I try to bring up the projects property page. I even went and deleted the project.config file that was created, to not luck to get the properties page back displaying.

Community
  • 1
  • 1
Edward
  • 864
  • 1
  • 7
  • 29

1 Answers1

0

You are out of luck here. Unity uses an older version of C# (4.4 as of Unity 5.5).

To see the exact version of C# you are using, run the line Debug.Log(System.Enviroment.Version); and check your log.

Blair
  • 6,623
  • 1
  • 36
  • 42
  • Where do I run that command? It didn't work in VS's Command Window. Also I understand Unity is using an older version, but shouldn't there be some way to upgrade? – Edward Mar 30 '17 at 21:45
  • You just run it somewhere in your code (ie in the `Start` method of a MonoBehaivour) and then check Unity's log. Unfortunately there is no way to upgrade it. – Blair Mar 31 '17 at 15:01
  • I just found this so haven't tested yet. [Upgrade](https://forum.unity3d.com/threads/upgraded-mono-net-in-editor-on-5-5-0b4.433541/) – Edward Apr 01 '17 at 01:31