Inheriting SimpleWorkerRequest

S

sureshsundar007

Hi all,

I'm trying to inherit the SimpleWorkerRequest class but cant able to
do so.
I'm getting an error called

"System.Web.Hosting.SimpleWorkerRequest.SimpleWorkerRequest()' is
inaccessible due to its protection level"

I tried my dervived class with public,internal and private
acces-specifiers..but the result is same.

Can anyone help me to fix this...

Thanks,
Suresh.
 
J

Jon Skeet [C# MVP]

sureshsundar007 said:
I'm trying to inherit the SimpleWorkerRequest class but cant able to
do so.
I'm getting an error called

"System.Web.Hosting.SimpleWorkerRequest.SimpleWorkerRequest()' is
inaccessible due to its protection level"

I tried my dervived class with public,internal and private
acces-specifiers..but the result is same.

Can anyone help me to fix this...

You're tring to call the parameterless constructor, which is
inaccessible. Make sure your constructors explicitly call the public or
protected constructors.

See http://www.pobox.com/~skeet/csharp/constructors.html for more
information.
 
S

sureshsundar007

Thanks for ur reply.

I did not even created a constructor (as i doesnt need a one).But
after adding a constructor and specifiyng one of the base class
constructor i've some other exception coming on runtime like this...

i created the constructor like this

public Request(): base(String.Empty,String.Empty,null)
{
}
(Here the constructor is argumentles..but itried with some different
parameters also)

The error i got on creating a new Request Object is..

"An unhandled exception of type 'System.NullReferenceException'
occurred in system.web.dll

Additional information: Object reference not set to an instance of an
object."

what i'm doing wrong here?

Thanks,
Suresh.
 
J

Jon Skeet [C# MVP]

sureshsundar007 said:
I did not even created a constructor (as i doesnt need a one).But
after adding a constructor and specifiyng one of the base class
constructor i've some other exception coming on runtime like this...

i created the constructor like this

public Request(): base(String.Empty,String.Empty,null)
{
}
(Here the constructor is argumentles..but itried with some different
parameters also)

The error i got on creating a new Request Object is..

"An unhandled exception of type 'System.NullReferenceException'
occurred in system.web.dll

Additional information: Object reference not set to an instance of an
object."

what i'm doing wrong here?

My guess is that the problem is your TextWriter parameter, which is
null.

What exactly are you wanting to do with SimpleWorkerRequest that would
make it make sense to effectively pass no useful parameters?
 

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