Saturday, March 24, 2012

w3wp.exe process crashing.

Hi all,
I have a problem which I've seen mentioned quite a few time around the net,
but nothing seems to work.
I've created a web service with one method (see code below). It's running
under IIS set to Windows Authentication. Calling the web service from a
client application or the browser works fine. The problem is that every few
minutes, I receive a "Memory cannot be written" error from w3wp.exe and the
web services dies. I then must proceed to shutting down visual studio,
empty the aspnet temporary files and restart IIS in order for the web
service to come back online. Otherwise I get a stupid "Mutex cannot be
created" error each time I try to connect to my web service. The crash
doesn't happen when I actually call on the web service, but rather several
minues after i leave my service.asmx website.
Why on earth does w3wp.exe crash?
/// ****************** CODE
[WebMethod]
public string MyMethod()
{
if (!(this.User.Identity is System.Security.Principal.WindowsIdentity))
{
return null;
}
System.Security.Principal.WindowsIdentity user = this.User.Identity as
System.Security.Principal.WindowsIdentity;
if (!user.IsAuthenticated || user.IsAnonymous)
{
return null;
}
return "Req User SID: " + user.Name;
}
/// ******************* CODEOne more piece of information: As soon as I start getting the "Mutex cannot
be created" error, I usually call 'iisreset' to reset IIS and then I receive
the "Memory cannot be read" error from w3wp.exe again.
"msnews.microsoft.com" <nospam@.no.spam> wrote in message
news:uAjdcvXBGHA.4016@.TK2MSFTNGP11.phx.gbl...
> Hi all,
> I have a problem which I've seen mentioned quite a few time around the
> net, but nothing seems to work.
> I've created a web service with one method (see code below). It's running
> under IIS set to Windows Authentication. Calling the web service from a
> client application or the browser works fine. The problem is that every
> few minutes, I receive a "Memory cannot be written" error from w3wp.exe
> and the web services dies. I then must proceed to shutting down visual
> studio, empty the aspnet temporary files and restart IIS in order for the
> web service to come back online. Otherwise I get a stupid "Mutex cannot
> be created" error each time I try to connect to my web service. The crash
> doesn't happen when I actually call on the web service, but rather several
> minues after i leave my service.asmx website.
> Why on earth does w3wp.exe crash?
>
> /// ****************** CODE
> [WebMethod]
> public string MyMethod()
> {
> if (!(this.User.Identity is System.Security.Principal.WindowsIdentity))
> {
> return null;
> }
> System.Security.Principal.WindowsIdentity user = this.User.Identity as
> System.Security.Principal.WindowsIdentity;
>
> if (!user.IsAuthenticated || user.IsAnonymous)
> {
> return null;
> }
> return "Req User SID: " + user.Name;
> }
> /// ******************* CODE
>

0 comments:

Post a Comment