too many arguments to 'Public Sub New()'

A

Allan Ebdrup

I have the following class in C# with two constructors
--------------
public class JobfolderEmailRecord
{
public JobfolderEmailRecord(int Id)
{
//code for constructor
}
public JobfolderEmailRecord(EmailTypeEnum EmailType, string strReference,
int intDepartmentId, int intJobfolderId, string strSubject, string
strRecipientEmail, string strRecipientName, string strSenderEmail, string
strSenderName)
{
//code for constructor
}
//more code for class
}
-------------

I reference and Import the dll from a ASP.Net project written in VB.Net

When I call JobfolderEmailRecords constructor i get the error:
"too many arguments to 'Public Sub New()'"

It seemt the VB.Net code can't see the constructor signatures, VB.Net only
sees a constructor with no arguments, but I don't even have such a
constructor. The funny thing is that all other method calls to the class
seem to parse just fine, and the code that produces the error used to work
before I recompiled the dll containing the JobfolderEmailRecord class.

I've tried to unload and reload the project but it doesn't help.

Can anyone help?

Kind Regards,
Allan Ebdrup
 
A

Allan Ebdrup

Figured it out, my webservice was named the same as my object so I was
trying to new the webservice, including the entire namespace path to my
class when newing it solved the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top