VB.NET codeDom

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Attempting to add a property to a class using
CodePropertySetValueReferenceExpression to add the set statement does not add
(byval value as <type>) so using te property fails. Any ideas?

MikeG
 
Thanks Naveen,

I dont get an error as such, the property is created as

Private Property integerProperty() As Integer
Get
Return Me.integerField
End Get
Set
Me.integerField = value
End Set
End Property

whereas it should be

Private Property integerProperty() As Integer
Get
Return Me.integerField
End Get
Set(ByVal Value As Integer)
Me.integerField = value
End Set
End Property

and so the application created does not work and it returns the error

"System.MissingMethodException: Method not found: Void
LEATESTNamespace.cLEADataEntity.set_name(System.String)."

Regards,

MikeG
 
Sorry the actual code produced is:

Private Property integerProperty as system.void
Get
Return Me.integerField
End Get
Set
Me.integerField = value
End Set
End Property

whereas it should be

Private Property integerProperty() As Integer
Get
Return Me.integerField
End Get
Set(ByVal Value As Integer)
Me.integerField = value
End Set
End Property

Thanks,

MikeG
 
Who access that method? A external program. If yes, change the modifier of
your method to Public.

Also, check if Me.IntegerField is a public property or public variable.


[]s
Cesar




Sorry the actual code produced is:

Private Property integerProperty as system.void
Get
Return Me.integerField
End Get
Set
Me.integerField = value
End Set
End Property

whereas it should be

Private Property integerProperty() As Integer
Get
Return Me.integerField
End Get
Set(ByVal Value As Integer)
Me.integerField = value
End Set
End Property

Thanks,

MikeG
 
I am closing this call as I have since discovered that the compiled code
produced runs and while the source code generated does not have the (value as
<datatype>) line, this does not appear to matter.

Thanks everyone.

MikeG

Ronchese said:
Who access that method? A external program. If yes, change the modifier of
your method to Public.

Also, check if Me.IntegerField is a public property or public variable.


[]s
Cesar




Sorry the actual code produced is:

Private Property integerProperty as system.void
Get
Return Me.integerField
End Get
Set
Me.integerField = value
End Set
End Property

whereas it should be

Private Property integerProperty() As Integer
Get
Return Me.integerField
End Get
Set(ByVal Value As Integer)
Me.integerField = value
End Set
End Property

Thanks,

MikeG

MikeG said:
Thanks Naveen,

I dont get an error as such, the property is created as

Private Property integerProperty() As Integer
Get
Return Me.integerField
End Get
Set
Me.integerField = value
End Set
End Property

whereas it should be

Private Property integerProperty() As Integer
Get
Return Me.integerField
End Get
Set(ByVal Value As Integer)
Me.integerField = value
End Set
End Property

and so the application created does not work and it returns the error

"System.MissingMethodException: Method not found: Void
LEATESTNamespace.cLEADataEntity.set_name(System.String)."

Regards,

MikeG
 
Back
Top