I found in the editor I could change the api compatibility level and the scripting runtime version to .net4.6. However in the actual solution (VS2015) my main project is still 3.5. Never fear I changed the project properties to target 4.6. I had to edit the csproj file to accomplish this as unity has never allowed me to right click > properties of a project. Anyhow upon reloading it says “Hey this project wants to be 4.6 but you only have 4.5.2 available on the machine (lies i have all the way up to 4.6.2)” It does mention a .net 4.6 subset profile for unity but search as I want there is no .net framework that goes by this name that I can find.
I’d really like to use 4.6 in my project as i have plugins that target 4.6 that i’d rather not rewrite.
I think i resolved this by changing the to 6 in the csproj file. It is compiling and letting me use things like null conditionals. The game appears to run fine.
Some earlier VSTU versions overwrite the project files every time you compile and switch the version automatically to .NET 3.5, as well as intercepting the window that lets you change the project settings and force-closing it just to stop you from being able to even select .NET 4. They were pretty adamant a year ago about how this was a great “feature”. You absolutely need to download the newest version where they’ve removed that again, and you can change the .NET version.
I can confirm that I fixed issue after upgrading to VSTU v3.1 (2017.b4 installed)
@makeshiftwings interesting comment about ability to view project properties as mine still intercepts windows even after upgrade which is annoying! Would love to have that ability back, it might be a great feature for beginners but annoying for the rest of us…
Thank you all! I can also confirm that it works with the VSTU 3.1 in Unity 2017.1.0b5. Maybe it would be a good idea to update the preview docs to mention this requirement.