Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unable to evaluate expressions during debug.

Discussion in 'Scripting' started by Chris-HG, Jul 19, 2018.

  1. Chris-HG

    Chris-HG

    Joined:
    Aug 10, 2012
    Posts:
    63
    I am unable to evaluate any expression values during debugging. Also adding anything to watch window results in 'The name x does not exist in the current context.'

    After I installed 2018, I deleted VS and reinstalled from MS.

    Is anyone else having this issue?

    VS 2017 Pro 7.5.3 (build 7)
    Unity 2018 1.6f1
    OSX 10.13.5

    Code (CSharp):
    1. System.ArgumentException: The field '<>f__ref$1' is not valid for this type.
    2.   at Mono.Debugger.Soft.ObjectMirror.GetValues (System.Collections.Generic.IList`1[T] fields) [0x000b0] in /Users/builder/data/lanes/5965/13cecd02/source/monodevelop/main/external/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs:93
    3.   at Mono.Debugger.Soft.ObjectMirror.GetValue (Mono.Debugger.Soft.FieldInfoMirror field) [0x00000] in /Users/builder/data/lanes/5965/13cecd02/source/monodevelop/main/external/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs:74
    4.   at Mono.Debugging.Soft.FieldValueReference.get_Value () [0x0006e] in /Users/builder/data/lanes/5965/13cecd02/source/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/FieldValueReference.cs:129
    5.   at Mono.Debugging.Soft.SoftDebuggerAdaptor.GetHoistedLocalVariables (Mono.Debugging.Soft.SoftEvaluationContext cx, Mono.Debugging.Evaluation.ValueReference vthis, System.Collections.Generic.HashSet`1[T] alreadyVisited) [0x0000b] in /Users/builder/data/lanes/5965/13cecd02/source/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs:944
    6.   at Mono.Debugging.Soft.SoftDebuggerAdaptor.GetHoistedLocalVariables (Mono.Debugging.Soft.SoftEvaluationContext cx, Mono.Debugging.Evaluation.ValueReference vthis, System.Collections.Generic.HashSet`1[T] alreadyVisited) [0x000d8] in /Users/builder/data/lanes/5965/13cecd02/source/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs:968
    7.   at Mono.Debugging.Soft.SoftDebuggerAdaptor+<GetLocalVariables>d__53.MoveNext () [0x000e2] in /Users/builder/data/lanes/5965/13cecd02/source/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs:1097
    8.   at Mono.Debugging.Soft.SoftDebuggerAdaptor.FindByName[T] (System.Collections.Generic.IEnumerable`1[T] items, System.Func`2[T,TResult] getName, System.String name, System.Boolean caseSensitive) [0x0003d] in /Users/builder/data/lanes/5965/13cecd02/source/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs:1217
    9.   at Mono.Debugging.Soft.SoftDebuggerAdaptor.OnGetLocalVariable (Mono.Debugging.Evaluation.EvaluationContext ctx, System.String name) [0x00100] in /Users/builder/data/lanes/5965/13cecd02/source/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs:1058
    10.   at Mono.Debugging.Evaluation.ObjectValueAdaptor.GetLocalVariable (Mono.Debugging.Evaluation.EvaluationContext ctx, System.String name) [0x00000] in /Users/builder/data/lanes/5965/13cecd02/source/monodevelop/main/external/debugger-libs/Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs:713
    11.   at Mono.Debugging.Evaluation.NRefactoryExpressionEvaluatorVisitor.VisitIdentifierExpression (ICSharpCode.NRefactory.CSharp.IdentifierExpression identifierExpression) [0x0003d] in /Users/builder/data/lanes/5965/13cecd02/source/monodevelop/main/external/debugger-libs/Mono.Debugging/Mono.Debugging.Evaluation/NRefactoryExpressionEvaluatorVisitor.cs:744
    12.   at ICSharpCode.NRefactory.CSharp.IdentifierExpression.AcceptVisitor[T] (ICSharpCode.NRefactory.CSharp.IAstVisitor`1[S] visitor) [0x00000] in /Users/builder/data/lanes/5965/13cecd02/source/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/IdentifierExpression.cs:79
    13.   at Mono.Debugging.Evaluation.NRefactoryExpressionEvaluator.Evaluate (Mono.Debugging.Evaluation.EvaluationContext ctx, System.String expression, System.Object expectedType) [0x00157] in /Users/builder/data/lanes/5965/13cecd02/source/monodevelop/main/external/debugger-libs/Mono.Debugging/Mono.Debugging.Evaluation/NRefactoryExpressionEvaluator.cs:82
    14.   at Mono.Debugging.Evaluation.ExpressionEvaluator.Evaluate (Mono.Debugging.Evaluation.EvaluationContext ctx, System.String exp) [0x00000] in /Users/builder/data/lanes/5965/13cecd02/source/monodevelop/main/external/debugger-libs/Mono.Debugging/Mono.Debugging.Evaluation/ExpressionEvaluator.cs:43
    15.   at Mono.Debugging.Evaluation.ObjectValueAdaptor.GetExpressionValue (Mono.Debugging.Evaluation.EvaluationContext ctx, System.String exp) [0x00000] in /Users/builder/data/lanes/5965/13cecd02/source/monodevelop/main/external/debugger-libs/Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs:1411
    16.  
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,713
    Yes, it comes and goes with various flavors of Mono and VS... and whenever it happens I just fall back to good old Debug.Log() outputting, as maddening as that can be with high loads of data.
     
    Chris-HG likes this.
  3. Chris-HG

    Chris-HG

    Joined:
    Aug 10, 2012
    Posts:
    63
    That sounds fun.
     
  4. Chris-HG

    Chris-HG

    Joined:
    Aug 10, 2012
    Posts:
    63
    Ok, Updating VS2017 (with a Installation Failed message) fixed the issue.
     
  5. Gerold_Meisinger

    Gerold_Meisinger

    Joined:
    Sep 8, 2015
    Posts:
    93
    Any update on this? I got the same issue. Most methods just display the error "Failed to find a match for foo()". I can't even call methods in the immediate window, same error. Does someone know how to make this work?

    Windows 10
    Unity 2018.2.0f2
    Visual Studio Community 2017 v15.8.4
    Visual Studio Tools for unity 3.8.0.6
     
    stroibot, EZaca and Slater5 like this.
  6. stroibot

    stroibot

    Joined:
    Feb 15, 2017
    Posts:
    90
    Any fix for this?