I am getting this error whenever I boot my project and again when I open the first script.
I am using unity 2019.4.10f1 and visual studio 2017
I can tell the error is because of my unity version + visual studio version, because when I install visual studio 2019 the error is fixed. But I don’t want to install visual studio 2019 I want to keep using 2017 because 2019 consumes a lot of my cpu and my fans go into overdrive just from having it open.
I also didnt have the error when I was using an older version of unity, but I’m stuck with this one since its what unityhub allows me to download and its too much of an hassle to downgrade and install android packages without unity hub.
So my question is, does anyone know if it is possible to fix this error without changing either software?
Here is the error, thanks!
ArgumentException: Value does not fall within the expected range.
SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit.LanguageOf (SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit unit) (at <46c1600e7cc74cd5bc97145420df9cc5>:0)
SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit.CompilationUnits () (at <46c1600e7cc74cd5bc97145420df9cc5>:0)
SyntaxTree.VisualStudio.Unity.Bridge.ProjectSystem.UnitySolutionBuilder..ctor () (at <46c1600e7cc74cd5bc97145420df9cc5>:0)
SyntaxTree.VisualStudio.Unity.Bridge.ProjectSystem.UnitySolutionBuilder.CreateSolutionFromAssetDatabase () (at <46c1600e7cc74cd5bc97145420df9cc5>:0)
SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilesGenerator.GenerateProject () (at <46c1600e7cc74cd5bc97145420df9cc5>:0)
SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilePostprocessor.OnPreGeneratingCSProjectFiles () (at <46c1600e7cc74cd5bc97145420df9cc5>:0)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <fb001e01371b4adca20013e0ac763896>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <fb001e01371b4adca20013e0ac763896>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <fb001e01371b4adca20013e0ac763896>:0)
UnityEditor.AssetPostprocessingInternal.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) (at <8004fcc221b54f98ba547350ea71d812>:0)
UnityEditor.AssetPostprocessingInternal.OnPreGeneratingCSProjectFiles () (at <8004fcc221b54f98ba547350ea71d812>:0)
UnityEditor.VisualStudioIntegration.SolutionSynchronizer.Sync () (at <8004fcc221b54f98ba547350ea71d812>:0)
UnityEditor.SyncVS.SyncVisualStudioProjectIfItAlreadyExists () (at <8004fcc221b54f98ba547350ea71d812>:0)
hmm actually deleting it had no effect, still popped the same error
however after reimporting the package(which I couldnt until i deleted the folder) i got an error that I already had the assemblies, even though I had them deleted( maybe there are copies somewhere else? )
PrecompiledAssemblyException: Multiple precompiled assemblies with the same name SyntaxTree.VisualStudio.Unity.Bridge.dll included or the current platform. Only one assembly with the same name is allowed per platform. Assembly paths:
C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/15.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll
Assets/UnityVS/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll
UnityEditor.Scripting.ScriptCompilation.EditorBuildRules.ValidateAndGetNameToPrecompiledAssembly (UnityEditor.Scripting.ScriptCompilation.PrecompiledAssembly[] precompiledAssemblies) (at <8004fcc221b54f98ba547350ea71d812>:0)
UnityEditor.Scripting.ScriptCompilation.EditorBuildRules.ToScriptAssemblies (System.Collections.Generic.IDictionary`2[TKey,TValue] targetAssemblies, UnityEditor.Scripting.ScriptCompilation.ScriptAssemblySettings settings, UnityEditor.Scripting.ScriptCompilation.EditorBuildRules+CompilationAssemblies assemblies, System.Collections.Generic.HashSet`1[T] runUpdaterAssemblies) (at <8004fcc221b54f98ba547350ea71d812>:0)
UnityEditor.Scripting.ScriptCompilation.EditorBuildRules.GenerateChangedScriptAssemblies (UnityEditor.Scripting.ScriptCompilation.EditorBuildRules+GenerateChangedScriptAssembliesArgs args) (at <8004fcc221b54f98ba547350ea71d812>:0)
UnityEditor.Scripting.ScriptCompilation.EditorCompilation.CompileScripts (UnityEditor.Scripting.ScriptCompilation.ScriptAssemblySettings scriptAssemblySettings, System.String tempBuildDirectory, UnityEditor.Scripting.ScriptCompilation.EditorScriptCompilationOptions options, UnityEditor.Scripting.ScriptCompilation.CompilationTaskOptions compilationTaskOptions, UnityEditor.Scripting.ScriptCompilation.EditorBuildRules+TargetAssembly[]& notCompiledTargetAssemblies, System.String[]& notCompiledScripts) (at <8004fcc221b54f98ba547350ea71d812>:0)
UnityEditor.Scripting.ScriptCompilation.EditorCompilation.CompileScripts (UnityEditor.Scripting.ScriptCompilation.EditorScriptCompilationOptions options, UnityEditor.BuildTargetGroup platformGroup, UnityEditor.BuildTarget platform, UnityEditor.Scripting.ScriptCompilation.CompilationTaskOptions compilationTaskOptions) (at <8004fcc221b54f98ba547350ea71d812>:0)
UnityEditor.Scripting.ScriptCompilation.EditorCompilation.TickCompilationPipeline (UnityEditor.Scripting.ScriptCompilation.EditorScriptCompilationOptions options, UnityEditor.BuildTargetGroup platformGroup, UnityEditor.BuildTarget platform) (at <8004fcc221b54f98ba547350ea71d812>:0)
UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface.TickCompilationPipeline (UnityEditor.Scripting.ScriptCompilation.EditorScriptCompilationOptions options, UnityEditor.BuildTargetGroup platformGroup, UnityEditor.BuildTarget platform) (at <8004fcc221b54f98ba547350ea71d812>:0)
UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:TickCompilationPipeline(EditorScriptCompilationOptions, BuildTargetGroup, BuildTarget)
Well there are, somewhere in either Library or Packages or something. I don’t have anything in front of me to try and tell you, so keep fiddling, you’ll probably get it fixed…
i guess it is using the assembly directly from the path C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/15.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll ?
That’s why it would claim duplicate when importing
It seems that theres a problem itself with the .dlls
Updating them would mean updating to visual studio 2019 which I wanted to avoid… I can live with seeing the error everytime I boot the project rather than having to use 2019, maybe the tools from vs2019 work for vs2017? I don’t know at this point