If I declare the following
Public Shared ReadOnly MY_CONST as String = "myConst"

I cant use the search text to find the value "myConst". Also, the disassembly does not show the literal. Is this broken, not implemented, or not possible? Thanks, Andrew
astanton
0

Comments

2 comments

  • Clive Tong
    When doing the search for myConst you need to be "searching strings or constants". To the right of the search text pane there are four icons - the third is the one that makes the search work in this mode. For me, typing myConst into the search pane and hitting ctrl-S (which switches to this mode) finds your example which I build into a class library.

    You can see the literal in the code for the static constructor (.cctor) and can also see this if you select the Class into which it is embedded and choose "expand methods".
    Public Class Class1
        ' Fields
        Public Shared ReadOnly MY_CONST2 As String = "myConst"
    End Class
    
    Clive Tong
    0
  • astanton
    Clive,
    Thank you! I knew it was in there somewhere, just figured the framework would behave similarly to declaring Const's. Thats what I get for assuming.
    -Andrew
    astanton
    0

Add comment

Please sign in to leave a comment.