I have a whole pile of C# classes that I need to convert to VB but I don't understand what some of the C is about.
Here's a typical C# class-
using System;
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.MessageContractAttribute(IsWrapped = false)]
public partial class CreateServiceToken_1_RequestMessage
{
[System.ServiceModel.MessageHeaderAttribute(Namespace = "http://www.reuters.com/ns/2008/03/01/webservices/rkd/Cache_1")]
public ThomsonReutersKnowledgeDirect.CacheRequest CacheRequest;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://www.reuters.com/ns/2006/05/01/webservices/rkd/TokenManagement_1", Order = 0)]
public ThomsonReutersKnowledgeDirect.CreateServiceToken_Request_1 CreateServiceToken_Request_1;
public CreateServiceToken_1_RequestMessage()
{
}
public CreateServiceToken_1_RequestMessage(ThomsonReutersKnowledgeDirect.CacheRequest CacheRequest, ThomsonReutersKnowledgeDirect.CreateServiceToken_Request_1 CreateServiceToken_Request_1)
{
this.CacheRequest = CacheRequest;
this.CreateServiceToken_Request_1 = CreateServiceToken_Request_1;
}
}
Telerik's online convertor gives me this in VB:
<System.Diagnostics.DebuggerStepThroughAttribute()> _
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")> _
<System.ServiceModel.MessageContractAttribute(IsWrapped:=False)> _
Partial Public Class CreateServiceToken_1_RequestMessage
<System.ServiceModel.MessageHeaderAttribute([Namespace]:="http://www.reuters.com/ns/2008/03/01/webservices/rkd/Cache_1")> _
Public CacheRequest As ThomsonReutersKnowledgeDirect.CacheRequest
<System.ServiceModel.MessageBodyMemberAttribute([Namespace]:="http://www.reuters.com/ns/2006/05/01/webservices/rkd/TokenManagement_1", Order:=0)> _
Public CreateServiceToken_Request_1 As ThomsonReutersKnowledgeDirect.CreateServiceToken_Request_1
Public Sub New()
End Sub
Public Sub New(CacheRequest As ThomsonReutersKnowledgeDirect.CacheRequest, CreateServiceToken_Request_1 As ThomsonReutersKnowledgeDirect.CreateServiceToken_Request_1)
Me.CacheRequest = CacheRequest
Me.CreateServiceToken_Request_1 = CreateServiceToken_Request_1
End Sub
End Class
Problem is that this produces all sorts of errors such as 'System.ServiceModel' is not defined.
Is the <> enclosed stuff required for VB or just left overs from C#?
BTW I'm using VS 2010
The 'stuff in <>' is needed, they are attributes.
Without knowing more, I would say that your errors are due to missing imports\usings.
Look at the top of the C# file, there are many using something.something
statements. These should have corresponding Imports something.something
in the VB file.