I am aiming to create a private static readonly field in VB.NET.
Public Class MyClass
Private Static ReadOnly someField As Regex = New Regex("somePattern")
End Class
This attempts to create a static property with only get access, but fails with the error:
'Static' is not valid on a member variable declaration.
In C#, I'd create this as follows:
public class MyClass
{
private static readonly Regex someField = new Regex("somePattern");
}
How can I create and initialize a field in this similar manner in VB.NET?