It seems that VB.NET and C# readonly keyword have some differences…
Say, a ReadOnly property in C# can be assigned in some conditions, but in VB.NET – never?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In C#, readonly is a field modifier. It specifies that the field can be assigned to only on initialization or in the constructor.
VB.NET is the same, except that ReadOnly is also a property modifier. It specifies that the property cannot be assigned to – i.e., it is a getter.