on targeting .Net 4.6 in Unity editor, VS 2017 ask to change the c# project to .Net 4.6/7 as well.
But after targeting VS2017 it loose the unity integration coding behavior completely.
* Is there the unity integration for VS2017 .Net4.6 available already, that works in the same way like Net 3.5? * When ignoring the new setting for Net 4.6 in VS2107, does this have any quirky behavior to the compiler code unity execute? Or does VS2017 compile to .Net 3.5 anyway?
* Does anyone know how to change back from VS2017 .Net4,7 to .Net 3.5 including the existing unity integration and without deleting all VS related files and folders in the project? Targeting back to .Net 3.5 in unity does not change/ask to set back VS2017 to the existing unity integration.
The integration of VS 2017 and Unity should be working for both the .NET 4.x equivalent runtime and the .NET 3.5 equivalent runtime in Unity.
First, please make sure that you have the latest version of Visual Studio Tools for Unity installed in Visual Studio 2017. You can check this with Help > About in Visual Studio.
Second, when you initially open a project with the .NET 4.x runtime (set in Unity), then Visual Studio should ask you to install the .NET 4.7.1 targeting pack. It sounds like this is the first thing you encountered. Installing that should not have any impact on the behavior with the .NET 3.5 equivalent runtime in Unity. In other words, changing the scripting runtime in Unity back to the old one should not require any changes in Visual Studio. Things should “just work” :).
We can investigate more though if that is not the case.
I went to : .NET SDKs for Visual Studio and installed the 4.7.1 run-time.
The result is the same message (see above), after open any script with VS2017.
First regarding Visual Studio and Visual Studio Tools for Unity:
For Visual Studio 2017: no need to go to the gallery, VSTU 2017 is part of the VS2017 installation, bundled with the Unity workload that you can install directly from the VS installer.
For previous version indeed, like VS2015, it was mandatory to install the extension from the gallery.
Regarding targeting packs, as Josh explained, Unity 2018.2b1 should be targeting .NET 4.7.1. Earlier versions of Unity should target .NET 4.6.
So double check that both .NET Targeting Packs 4.6 and 4.7.1 are properly installed in your Visual Studio 2017 installation:
You should never change the targeting in your projects, because the project file will be re-generated. It’s mandatory to fix this issue if you want to keep a proper integration between Unity and VS.
After switching back to net3.5. Close Unity. Delete all .csproj and .sln files. Start unity open any script. After vs2017 starts in the right top bar → Solution explorer → right click each solution and click refresh.
I had this issue and all my builds were giving me a console. I was able to force refresh by changing Target Platform Architecture to x86 then back to x86_64.