Upgraded to unity 2018.1.0f2 and VS Project is no longer generated

Hello,

I ran into this issue after the update.

I’m using Visual Studio 2013 and have Unity tools installed. I’ve tried reinstalling them but the problem is not going away.

The problem is that the sln and the csproj files are not generated. Because of this I cannot use autocomplete and it’s a pain to try to code anything.

The projects that I’ve created before this are working properly. I can still use auto complete and the project files are good.

The following error pops up on new projects in the unity console:


ArgumentException: Value does not fall within the expected range.
SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit.LanguageOf (SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit unit)
SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit.CompilationUnits ()
SyntaxTree.VisualStudio.Unity.Bridge.ProjectSystem.UnitySolutionBuilder…ctor ()
SyntaxTree.VisualStudio.Unity.Bridge.ProjectSystem.UnitySolutionBuilder.CreateSolutionFromAssetDatabase ()
SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilesGenerator.GenerateProject ()
SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilePostprocessor.OnPreGeneratingCSProjectFiles ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.AssetPostprocessingInternal.OnPreGeneratingCSProjectFiles () (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:91)
UnityEditor.VisualStudioIntegration.SolutionSynchronizer.Sync () (at C:/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:196)
UnityEditor.SyncVS.SyncSolution () (at C:/buildslave/unity/build/Editor/Mono/SyncProject.cs:190)

I’m going to answer my own question since I managed to fix it.

I’ve reinstalled Unity and along with it, Visual Studio Community 2017.

After that I’ve played with the preferences and switch back and forth between VS2013 (that I had installed) and 2017.

It looks like 2013 is unable to work with unity in the sense where it doesn’t update the project files when it’s the version selected in the “external tools” settings.

Now in order to work I keep 2017 selected from preferences but I open the project file with 2013.

[ problem solved for me ]

1- Upgrade Visual Studio 2015 tools for unity to the last version Version v3.7.0.1

Last updated 10/05/2018 à 01:27:4

2- Restart Unity and VS
3- open visual studio and go to tools–>NuGet Package Manger —>Package Manager Console

Install-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform

thats work .

you can t tracked visual studio erros on .log file to know what was te problem.

can u say this in details? i meet the same problem my friend, i update to unity 2018.1.1f1,but it does’t work.,same trouble came again

[problem solved]

Did the same as sisocano, except I only installed unity tools for visual studio 2015 from Quickstart: Install & configure Visual Studio Tools for Unity | Microsoft Learn

Unity 2019.1.9f1 and VS2015.

same occurs unity 2020.2.1f1 and VS 2019, and I still don’t find solution.