Script Updater Problems

Any chance that you open sourced the Script Updater for Unity 5? Why is this not an Editorscript that you can Debug anyway?

I just can’t get in to work, I got rid of all the errors he tells me about but still I get an exception:

Error

Could not start compilationException: Failed running ScriptUpdater.exe its output was:stdout:
stderr:

Unhandled Exception:
System.ArgumentOutOfRangeException: Cannot be negative.

Parameter name: length

at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in :0

at CSharpUpdater.MethodReferenceResolver.IsDelegateOfType (ICSharpCode.NRefactory.Semantics.ResolveResult varType, System.Type[ ] delegateTypes) [0x00000] in :0

at CSharpUpdater.MethodReferenceResolver.ResolveOverloadDelegateType (ICSharpCode.NRefactory.CSharp.Expression expression, ICSharpCode.NRefactory.Semantics.ResolveResult variableType, ICSharpCode.NRefactory.CSharp.Resolver.MethodGroupResolveResult methodGroup) [0x00000] in :0

at CSharpUpdater.MethodReferenceResolver.ResolveOverload (ICSharpCode.NRefactory.CSharp.Expression expression, ICSharpCode.NRefactory.CSharp.AstNode deletegateType) [0x00000] in :0

at CSharpUpdater.MethodReferenceResolver.VisitVariableInitializer (ICSharpCode.NRefactory.CSharp.VariableInitializer variableInitializer) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.VariableInitializer.AcceptVisitor[IMember] (IAstVisitor`1 visitor) [0x00000] in :0

at CSharpUpdater.MethodReferenceResolver.Resolve (ICSharpCode.NRefactory.CSharp.Expression expression, CSharpUpdater.CSharpUpdateContext context) [0x00000] in :0

at CSharpUpdater.ReplacingAstVisitor.ResolveMethod (ICSharpCode.NRefactory.CSharp.Expression expression) [0x00000] in :0

at CSharpUpdater.MemberReferenceReplacerBase`1[APIUpdater.Framework.Configuration.MethodRetargetConfig].VisitMemberReferenceExpression (ICSharpCode.NRefactory.CSharp.MemberReferenceExpression memberReferenceExpression) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.MemberReferenceExpression.AcceptVisitor (IAstVisitor visitor) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitVariableInitializer (ICSharpCode.NRefactory.CSharp.VariableInitializer variableInitializer) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.VariableInitializer.AcceptVisitor (IAstVisitor visitor) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitFieldDeclaration (ICSharpCode.NRefactory.CSharp.FieldDeclaration fieldDeclaration) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.FieldDeclaration.AcceptVisitor (IAstVisitor visitor) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitTypeDeclaration (ICSharpCode.NRefactory.CSharp.TypeDeclaration typeDeclaration) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.TypeDeclaration.AcceptVisitor (IAstVisitor visitor) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitSyntaxTree (ICSharpCode.NRefactory.CSharp.SyntaxTree syntaxTree) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.SyntaxTree.AcceptVisitor (IAstVisitor visitor) [0x00000] in :0

at CSharpUpdater.CSharpUpdater.RunUpdater (APIUpdater.Framework.Core.SourceFile[ ] inputs, IEnumerable1 defines, IEnumerable1 references) [0x00000] in :0

at APIUpdater.Framework.Core.APIUpdaterBase.Update (APIUpdater.Framework.Core.SourceFile[ ] inputs, IEnumerable1 defines, IEnumerable1 references) [0x00000] in :0

at ScriptUpdater.Program.UpdateLanguage (IScriptUpdater updater, APIUpdater.Framework.Configuration.CompilerResponseFile responseFile, System.String unityDataPath, System.String outputPath) [0x00000] in :0

at ScriptUpdater.Program.Main (System.String[ ] args) [0x00000] in :0
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentOutOfRangeException: Cannot be negative.

Parameter name: length

at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in :0

at CSharpUpdater.MethodReferenceResolver.IsDelegateOfType (ICSharpCode.NRefactory.Semantics.ResolveResult varType, System.Type[ ] delegateTypes) [0x00000] in :0

at CSharpUpdater.MethodReferenceResolver.ResolveOverloadDelegateType (ICSharpCode.NRefactory.CSharp.Expression expression, ICSharpCode.NRefactory.Semantics.ResolveResult variableType, ICSharpCode.NRefactory.CSharp.Resolver.MethodGroupResolveResult methodGroup) [0x00000] in :0

at CSharpUpdater.MethodReferenceResolver.ResolveOverload (ICSharpCode.NRefactory.CSharp.Expression expression, ICSharpCode.NRefactory.CSharp.AstNode deletegateType) [0x00000] in :0

at CSharpUpdater.MethodReferenceResolver.VisitVariableInitializer (ICSharpCode.NRefactory.CSharp.VariableInitializer variableInitializer) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.VariableInitializer.AcceptVisitor[IMember] (IAstVisitor`1 visitor) [0x00000] in :0

at CSharpUpdater.MethodReferenceResolver.Resolve (ICSharpCode.NRefactory.CSharp.Expression expression, CSharpUpdater.CSharpUpdateContext context) [0x00000] in :0

at CSharpUpdater.ReplacingAstVisitor.ResolveMethod (ICSharpCode.NRefactory.CSharp.Expression expression) [0x00000] in :0

at CSharpUpdater.MemberReferenceReplacerBase`1[APIUpdater.Framework.Configuration.MethodRetargetConfig].VisitMemberReferenceExpression (ICSharpCode.NRefactory.CSharp.MemberReferenceExpression memberReferenceExpression) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.MemberReferenceExpression.AcceptVisitor (IAstVisitor visitor) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitVariableInitializer (ICSharpCode.NRefactory.CSharp.VariableInitializer variableInitializer) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.VariableInitializer.AcceptVisitor (IAstVisitor visitor) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitFieldDeclaration (ICSharpCode.NRefactory.CSharp.FieldDeclaration fieldDeclaration) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.FieldDeclaration.AcceptVisitor (IAstVisitor visitor) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitTypeDeclaration (ICSharpCode.NRefactory.CSharp.TypeDeclaration typeDeclaration) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.TypeDeclaration.AcceptVisitor (IAstVisitor visitor) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitSyntaxTree (ICSharpCode.NRefactory.CSharp.SyntaxTree syntaxTree) [0x00000] in :0

at ICSharpCode.NRefactory.CSharp.SyntaxTree.AcceptVisitor (IAstVisitor visitor) [0x00000] in :0

at CSharpUpdater.CSharpUpdater.RunUpdater (APIUpdater.Framework.Core.SourceFile[ ] inputs, IEnumerable1 defines, IEnumerable1 references) [0x00000] in :0

at APIUpdater.Framework.Core.APIUpdaterBase.Update (APIUpdater.Framework.Core.SourceFile[ ] inputs, IEnumerable1 defines, IEnumerable1 references) [0x00000] in :0

at ScriptUpdater.Program.UpdateLanguage (IScriptUpdater updater, APIUpdater.Framework.Configuration.CompilerResponseFile responseFile, System.String unityDataPath, System.String outputPath) [0x00000] in :0

at ScriptUpdater.Program.Main (System.String[ ] args) [0x00000] in :0

UnityEditor.Scripting.Compilers.MonoScriptCompilerBase.RunUpdatingProgram (System.String executable, System.String arguments) (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/MonoScriptCompilerBase.cs:83)
UnityEditor.Scripting.Compilers.MonoScriptCompilerBase.RunUpdater (System.String responseFile) (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/MonoScriptCompilerBase.cs:53)
UnityEditor.Scripting.Compilers.MonoScriptCompilerBase.StartCompiler (BuildTarget target, System.String compiler, System.Collections.Generic.List1 arguments, Boolean setMonoEnvironmentVariables) (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/MonoScriptCompilerBase.cs:37) UnityEditor.Scripting.Compilers.MonoScriptCompilerBase.StartCompiler (BuildTarget target, System.String compiler, System.Collections.Generic.List1 arguments) (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/MonoScriptCompilerBase.cs:28)
UnityEditor.Scripting.Compilers.MonoCSharpCompiler.StartCompiler () (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/MonoCSharpCompiler.cs:43)
UnityEditor.Scripting.Compilers.ScriptCompilerBase.BeginCompiling () (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/ScriptCompilerBase.cs:47)

Any chance to get this solved without uploading my whole 12GB Project as an Bug Report :wink: ?

Hi.

I’ve just fixed a bug with exact the same call stack :wink: (BTW, also in a big project)

This fix will be included in the next beta.

3 Likes

haha okay I’ll stop adding GetComponents manually and wait for it ;). Thanks a bunch!