After quite some frustrating research into VB auto properties. I decided to just ignore them. So I had this code.
Public Class Categoria
Private _nome As String
Public ReadOnly Property Nome As String
Get
Return _nome
End Get
End Property
Public Sub New(nome As String)
Me._nome = nome
End Sub
End Class
But Visual Studio, being helpful, suggested to use auto-properties. I agreed, I even tried that before but he offered help in the form of a click here and I will do it. So I did. And he did exactly the same code I was not having any luck with before, char by char.
Public Class Categoria
Public ReadOnly Property Nome As String
Public Sub New(nome As String)
Me.Nome = nome
End Sub
End Class
Can someone shed some light as to why the last piece of code fails to compile with error BC30126: 'ReadOnly' property must provide a 'Get'.
?
Aparently VS is missing the same as I am, so I don't feel so stupid anymore.