VB.NET Auto-Implemented Properties - Compatibility between VS2010 and VS2008
I am working on an ASP.NET project where I use VB.NET within Visual Studio 2010. Some of the other developers on the project are using Visual Studio 2008. We all check our code into single SVN repository. I would like to start using Auto-Implemented Properties within VB.NET ...
Property FirstName as String
instead of ...
Private FirstName as String
Public Property FirstName() As String
Get
Return _FirstName
End Get
Set(ByVal value As String)
_FirstName = value
End Set
End Property
My concern is that this could mess up things for those using VS2008. What wou开发者_高级运维ld happen if someone using VS2008 needed to modify my class that made use of Auto-Implemented Properties? I am assuming that since everything compiles down to IL code then there would be no issue in binary compatibility. Though a problem would arise when editing source. I am a correct or mistaken on this? Thank you.
They will get a compilation error
Property missing 'End Property'.
Property without a 'ReadOnly' or 'WriteOnly' specifier must provide both a 'Get' and a 'Set'.
精彩评论