Skip to content

Detecting Auto-Implemented Properties in VB #201

@ghost

Description

There seems to be a discrepancy in how the library detects auto-implemented properties in VB vs C#

I created two brand-new MVC projects for testing.

  • Visual Studio 2015 Update 1
  • Projects targeted for .NET 4.5.2
  • Installed FileHelpers from NuGet, Version 3.1.5 (8/7/2015)

C#

[IgnoreFirst]
[DelimitedRecord(",")]
public class WrkShop
{
    public string Title { get; set; }
    //plus other properties
}

//Instantiating WORKS
FileHelperEngine<WrkShop> engWrkShop = new FileHelperEngine<WrkShop>();

VB

<IgnoreFirst>
<DelimitedRecord(",")>
Public Class WrkShop
    Public Property Title As String
    'plus other properties
End Class

'Instantiating THROWS AN EXCEPTION
Dim EngWrkShop As FileHelperEngine(Of WrkShop) = New FileHelperEngine(Of WrkShop)

Stack Trace

[ArgumentNullException: Value cannot be null.
Parameter name: name]
   System.Type.GetProperty(String name) +11434556
   FileHelpers.FieldBase.CreateField(FieldInfo fi, TypedRecordAttribute recordAttribute) +1549
   FileHelpers.RecordInfo.CreateCoreFields(IList`1 fields, TypedRecordAttribute recordAttribute) +93

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions