As kevin says, you need to create a constructor...
Publc Sub New(ByVal identity As IIdentity, ByVal roles As String())
perhaps you are used to C# where the constructor is the name of the
class...in VB.Net, you use the New keyword as the constructor name...
karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:es**************@tk2msftngp13.phx.gbl...
A Sub is not a class. The New Operator is for creating instances of
classes.
--
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.
"david" <da***@discussions.microsoft.com> wrote in message
news:06**********************************@microsof t.com...
I am new to VB.NET. Anyone could give a hint? Thanks.
What is the problem about the following code:
Dim myPrincipal As CustomPrincipal = New CustomPrincipal(id, roles)
where CustomPrincipal is constructor defined as
Public Sub CustomPrincipal(ByVal identity As IIdentity, ByVal roles As
String())
the error message:
Too many arguments to 'Public Sub New()'.