Application_error event and Windows 2003

C

Chris Leffer

Hi.

I have the following code in my Global.asax Application_error event:

Dim lgEntryLog As New Logs.Custom
Dim exApp As Exception = Server.GetLastError.GetBaseException

Try
With lgEntryLog
.LogFile = "Site.log"
.LogPath = Request.PhysicalApplicationPath
.Message = exApp.Message
.Source = exApp.Source
.MethodName = exApp.TargetSite.Name
.Url = Request.Url.ToString
.WriteData()
End With

Catch Ex As Exception
Throw Ex
End Try

That code works pretty well in my Windows 2000 workstation. It uses a
custom class that creates a text file and writes in it the information
collected above.

When I run the application in Windows 2003, under production, and some
error is thrown, the file is not created. My site is under
DefaultAppPool in IIS 6.0.
Could it be permissions issues?

Regards,
Chris Leffer
 
J

Jim Cheshire [MSFT]

Chris,

Does the NETWORK SERVICE account have write permissions to that file?

Jim Cheshire [MSFT]
MCP+I, MCSE, MCSD, MCDBA
Microsoft Developer Support
(e-mail address removed)

This post is provided "AS-IS" with no warranties and confers no rights.

--------------------
 
C

Chris Leffer

Hi Jim.

No, I didn't change anything related to permissions for the Network
Service account. Should I allow writes to only the file or to the
directory?

Since the Network Service account can't write to the file, shouldn't I
receive an exception when the application tries to access the file?

Thanks.
Chris Leffer
 
J

Jim Cheshire [MSFT]

Hi Chris,

Yes, you should. If memory serves, you didn't give us the complete error
you are receiving. If you attach the HTML file itself to your post, I can
look at the full stack trace (it's in the HTML comments) to see what
happened.

Jim Cheshire [MSFT]
MCP+I, MCSE, MCSD, MCDBA
Microsoft Developer Support
(e-mail address removed)

This post is provided "AS-IS" with no warranties and confers no rights.


--------------------
 
J

Jim Cheshire [MSFT]

Sorry, Chris. I got your post confused with another one. Can you please
make sure to include the entire thread when replying? I am working a ton
of newsgroup cases and I get them mixed up.

Jim Cheshire [MSFT]
MCP+I, MCSE, MCSD, MCDBA
Microsoft Developer Support
(e-mail address removed)

This post is provided "AS-IS" with no warranties and confers no rights.


--------------------
Newsgroups: microsoft.public.dotnet.framework.aspnet
From: (e-mail address removed) (Jim Cheshire [MSFT])
Organization: Microsoft
Date: Tue, 10 Aug 2004 14:19:01 GMT
Subject: RE: Application_error event and Windows 2003
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi Chris,

Yes, you should. If memory serves, you didn't give us the complete error
you are receiving. If you attach the HTML file itself to your post, I can
look at the full stack trace (it's in the HTML comments) to see what
happened.

Jim Cheshire [MSFT]
MCP+I, MCSE, MCSD, MCDBA
Microsoft Developer Support
(e-mail address removed)

This post is provided "AS-IS" with no warranties and confers no rights.


--------------------
From: Chris Leffer <[email protected]>
References: <[email protected]>
X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
Subject: RE: Application_error event and Windows 2003
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Date: Mon, 09 Aug 2004 10:04:45 -0700
NNTP-Posting-Host: 67.41.129.85
Lines: 1
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:253166
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Hi Jim.

No, I didn't change anything related to permissions for the Network
Service account. Should I allow writes to only the file or to the
directory?

Since the Network Service account can't write to the file, shouldn't I
receive an exception when the application tries to access the file?

Thanks.
Chris Leffer
 

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

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top