In Visual Studio I cannot get the value of a constant during debug. This is the declaration part of a function:
Const msroot As String = "https://www.someurl.ext"
Dim tls12 As SecurityProtocolType = 3072
Dim coder As Encoding = Encoding.GetEncoding("utf-16")
Stepping through (F8) the program the msroot value cannot be displayed in the immediate pane. Furthermore the defining line is left from the line executions, only the Dim statements are stepped in. So I cannot check or use the value of the constant in the immediate window. An error message is thrown:
?msroot
error BC30451: 'msroot' is not declared. It may be inaccessible due to its protection level.
If the program runs, the constant value is assigned and can be used in expressions.If hovering over it in the program nothing is shown.But if somewhere in the program there is a wait for input e.g. (modal window)
MessageBox.Show(msroot, "Message", MessageBoxButtons.YesNo)
during displaying the message switch back to Visual Studio window, hovering over the constant name, it is displaying the correct value.Is there a way to get the value of the constants in the immediate window?
Thanks in advance