简体   繁体   中英

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 would 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'.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM