none
Variable names are changing case during runtime RRS feed

  • Question

  • First, some background.  Running Visual Studio Professional 2015.  This project has a mix of VB and C# code.  The code where the issue takes place is a VB controller.  This code has existed and functioned flawlessly for months until just last week.  

    Code looks like:

    <HttpGet()>

    <Authorize(Roles:="role")>

    Public Function BuildReport(param1 As Integer) As ActionResult

    Try

    Dim model = geGetModel(param1)

    Dim result = New With {.success = True, .Model = model}

    Return Json(result, JsonRequestBehavior.AllowGet)

    End Try

    End Function

    Now the issue is that during runtime, when setting a breakpoint on the "Return Json..." line, inspection of the variable "result" reveals that "result" contains 2 properties - "success" and "model" with a lowercase "m".

    Why are my variables changing case during runtime?

    Monday, November 28, 2016 4:49 PM

Answers

  • Probably you have another ‘New With { .success = ..., .model = ... }’ in some other place, which is merged with your definition into a single internal declaration (to reduce the resources), since VB is case-insensitive. Seems to be a non-critical problem of the Debugger.




    • Edited by Viorel_MVP Monday, November 28, 2016 5:51 PM
    • Marked as answer by Hooplah123 Monday, November 28, 2016 6:12 PM
    Monday, November 28, 2016 5:50 PM

All replies

  • Probably you have another ‘New With { .success = ..., .model = ... }’ in some other place, which is merged with your definition into a single internal declaration (to reduce the resources), since VB is case-insensitive. Seems to be a non-critical problem of the Debugger.




    • Edited by Viorel_MVP Monday, November 28, 2016 5:51 PM
    • Marked as answer by Hooplah123 Monday, November 28, 2016 6:12 PM
    Monday, November 28, 2016 5:50 PM
  • This is precisely the cause.  Thank you most kindly.
    Monday, November 28, 2016 6:13 PM