Could anyone tell me why executing this
Module Module1
Sub Main()
Dim currentSourceData As New SourceData
currentSourceData.datafiles.Add("234")
End Sub
End Module
Does give me
System.NullReferenceException: 'Object reference not set to an instance of an object.'
When I use automatic implemented prpoerties
Public Class SourceData
Public Property datafiles() As List(Of String)
End Class
But it does not when I use a property fully written:
Public Class SourceData
Private _datafiles As New List(Of String)
Public Property datafiles() As List(Of String)
Get
Return _datafiles
End Get
Set(value As List(Of String))
_datafiles = value
End Set
End Property
End Class