Search Issue Tracker
Postponed means that the issue was either a feature request or something that requires major refactoring on our side. Since that makes the issue not actionable in the close future we choose to close it as Postponed and add it on our internal roadmaps and technical debt pages instead.
Postponed
Votes
3
Found in
2017.2.0b2
Issue ID
928082
Regression
Yes
ArgumentException error pops up after editing script in Visual Studio
How to reproduce:
1. Open attached Unity project "Blank.zip"
2. Open Assets folder in the Project window
3. Open GlobalScript.cs script with Visual Studio
Expected Result: script opens without any errors.
Actual Result: error "ArgumentException: Value does not fall within the expected range" pops up.
Regression first introduced in: 2017.2.0a2
Reproducible with: 2017.2.0a2, 2017.2.0b3
Not reproducible with: 5.5.4.p2, 5.6.2p3, 2017.1.0f3, 2017.2.0a1
Notes:
* This error pops up only when opening a script the first time.
* Error pops up after opening, creating or deleting script.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Dragon Crashers] Build fails in U6
- [Dragon Crashers] 4 Shader error messages on import
- [Dragon Crashers] Readme text is white on light grey
- Cursor stays in front of the first character when entering text in the TextMeshPro field
- Searching in Hierarchy causes unwanted component calls
mythraend
Dec 16, 2018 16:18
Halleluiah! The bridge is still broken but using the work around that MafiaMoe mentioned by using Solution Explorer to import the file works!!!! It's strange but for some reason I feel much less of an urge to pull my hair out and punch walls.
fashrista
Jul 27, 2018 12:51
I also encountered this. I have installed Unity 2018.2.0f2 personal with linux build support(and everything else also) and am working via tortoise svn version control on a project started a year ago in some other unity version. (donno if that info helps).
Will try the above mentioned workaround.
Also monodevelop methods are highlited in Visual studio as errors, but the code compiles and the project runs ...
I am now updating visual studio, to see if that helps.
Zullar
Jul 19, 2018 21:39
I also have this error after installing 2018.20f2
Alex_May
May 08, 2018 09:59
OK, fully uninstalling and reinstalling all installations of Unity and VS2017 has fixed the issue for me.
MafiaMoe
May 07, 2018 09:01
@Alex_may : Workaround for me is to add any new files to the Visual Studio project manually, given one already exists to start from.
eg. Inside Visual Studio, right-click on the folder that has the new .cs files and select 'Add > Existing Item', then select all the new files.
Update* Reinstalling Unity 2018 with or without Linux build support did not fix this.
MafiaMoe
May 07, 2018 08:37
This issue is also cropping up with any project opened using 2018.1.0f2. This may have been introduced when adding Linux build support to the install.
All of my projects opened using previous versions of Unity function normally.
Alex_May
May 06, 2018 08:21
Is there a workaround for this?
bschla
Apr 11, 2018 09:20
Same error with:
* Create a new project with Unity 2018.1.0.b13
* Assets --> Open C# Projects
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 (System.String method)
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)
UnityEditor.SyncVS.SyncAndOpenSolution () (at C:/buildslave/unity/build/Editor/Mono/SyncProject.cs:181)