2

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.

ChrisA
  • 4,163
  • 5
  • 28
  • 44
webworm
  • 10,587
  • 33
  • 120
  • 217
  • 1
    Automatic properties aren't supported in VB.Net 9.0 (the highest version supported by VS 2008), so this will give an error in VS 2008 on compilation. – Binary Worrier Apr 29 '11 at 14:48

1 Answers1

9

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

Bala R
  • 107,317
  • 23
  • 199
  • 210