VB.NET doesn't like <ReferenceType(gettype(FormatterNode)> attribute?

Topics: Building and extending application blocks, Enterprise Library Core, Logging Application Block
Feb 27, 2007 at 10:29 PM
I was implementing a EmailTraceListenerNode for EntLib 2.0 in VB.NET and I couldn't the compiler can't seem handle this attribute based language translation -

Namespace --> Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.Design.TraceListeners

C#
Editor(typeof(ReferenceEditor), typeof(UITypeEditor))
ReferenceType(typeof(FormatterNode))
SRDescription("FormatDescription", typeof(Resources))
SRCategory("CategoryGeneral", typeof(Resources))
public FormatterNode Formatter
{
get { return formatterNode; }
set
{
formatterNode = LinkNodeHelper.CreateReference<FormatterNode>(formatterNode,
value,
OnFormatterNodeRemoved,
OnFormatterNodeRenamed);

formatterName = formatterNode == null ? String.Empty : formatterNode.Name;
}
}

VB.NET
<Editor(GetType(ReferenceEditor), GetType(UITypeEditor))> _
<ReferenceType(gettype(FormatterNode)> _
<SRDescription("FormatDescription", GetType(Resources))> _
<SRCategory("CategoryGeneral", GetType(Resources))> _
Public Property Formatter() As FormatterNode
Get
Return _formatterNode
End Get
Set(ByVal value As FormatterNode)

_formatterNode = LinkNodeHelper.CreateReference(Of FormatterNode)(FormatterNode, _
value, _
OnFormatterNodeRemoved, _
OnFormatterNodeRenamed)

If _formatterNode Is Nothing Then
_formatterName = String.Empty
Else
_formatterName = _formatterNode.Name
End If
End Set
End Property

I'm sure my references and namespace inclusions are the same. Should I not be extending the Enterprise Library in VB.NET or am I missing something?
Thanks,
Bruce
Feb 28, 2007 at 12:45 AM
Could it be that that you are missing a close bracket on the offending line?

The only other thing I can think of is that VB lets you specify a root namespace in the project properties dialog, which can sometimes result in confusion about namespace qualifications.

HTH
Tom
Feb 28, 2007 at 4:10 PM
That was it Tom,
Thanks for the sanity check, I think I just converted way to much C# code and I was loosing my mind. I'm done coding in VB.NET when extending the EntLib library for simply for the sake of consistency in my applications and standards. More trouble than it's worth. The C# -> VB.NET translators choke on almost all the EntLib code and I have had to convert most of it by hand.
Bruce