Inheriting SimpleWorkerRequest

  • Thread starter Thread starter sureshsundar007
  • Start date Start date
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.
 
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.
 
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.
 
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?
 
Back
Top