By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,301 Members | 1,766 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,301 IT Pros & Developers. It's quick & easy.

.NET Runtime Application Log Error, Server crashing due to .NET Er

P: n/a
I have a load balanced system that consists of 3 production servers. There
are about 20 different applications that are used on these boxes. One of my
applications in particular is used more than the others. Since updating 2
applications, I have had problems on the event log of the servers, following
stopping of the aspnet_ws.exe process.

Something is causing the following error in the windows application event log:

The description for Event ID ( 0 ) in Source ( .NET Runtime ) cannot be
found. The local computer may not have the necessary registry information or
message DLL files to display messages from a remote computer. The following
information is part of the event: .NET Runtime version 1.1.4322.2032- Setup
Error: Failed to load resources from resource file

This is usually followed by the crashing of the aspnet_ws.exe process, which
will crash all users that are in any application on the server. This happens
about 3-8 times per day, at random times, with an absolute unknown cause for
this.

I have searched all over the net for help on this error, and I cannot find a
single answer that will fix this. I am thinking it is is something in my
code, but what is odd is that this error does NOT happen at anytime on our
test server or my local computer that uses the same application.

We test the application constantly on the test server, and no matter what,
the log never receives this error. It is possible that the reason for this
is the higher load on our production servers. There are usually 85 - 100
users simultaneously hitting the box.

Here is an example of the new stuff that has been added since I have been
starting to get that error. (Prior to adding this code, I have never seen
this error in the log.)

Code:

Imports System.Threading

Public Sub PostDocument
Dim ThreadPost As New Thread(New ThreadStart(AddressOf ExecutePost))
ThreadPost.Priority = ThreadPriority.Lowest
ThreadPost.Start()
End Sub

Public Sub ExecutePost()
Dim mut As Mutex = New Mutex
mut.WaitOne()
Try
Dim oHB As New HostBridgeLink(gsURL, "F400", UserID, Password,
Token)
oHB.ExecCmdWithData("PF10", "WEBIND=Y") : oHB.ExecCmd("PF8")
Catch ex As Exception
Finally
mut.ReleaseMutex()
End Try
End Sub

All of the above code works correctly in test, and production too. I am just
wondering if excessive use of any of the above at simultaneous times could
cause problems? Is there something I need to do to the server to handle the
Threading? Am I forgetting another step that will cause a problem on the
server?

I am using threading because the response time was very slow on our servers,
so I do not wait for a response. Its a new method I chose, and works
excellent, however, now the servers are still receiving that above message,
and the Memory usage does not even exceed 300K, whereas in the past, it used
to go all the way up to 900K when it crashed.

This is a major problem, and needs to be resolved fast.
Any help would be greatly appreciated. Thank you.

- Vincent
Jul 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"VinnieT" <Vi*****@discussions.microsoft.com> wrote in message
news:00**********************************@microsof t.com...
I have a load balanced system that consists of 3 production servers. There
are about 20 different applications that are used on these boxes. One of
my
applications in particular is used more than the others. Since updating 2
applications, I have had problems on the event log of the servers,
following
stopping of the aspnet_ws.exe process.

Something is causing the following error in the windows application event
log:

The description for Event ID ( 0 ) in Source ( .NET Runtime ) cannot be
found. The local computer may not have the necessary registry information
or
message DLL files to display messages from a remote computer. The
following
information is part of the event: .NET Runtime version 1.1.4322.2032-
Setup
Error: Failed to load resources from resource file

This is usually followed by the crashing of the aspnet_ws.exe process,
which
will crash all users that are in any application on the server. This
happens
about 3-8 times per day, at random times, with an absolute unknown cause
for
this.

I have searched all over the net for help on this error, and I cannot find
a
single answer that will fix this. I am thinking it is is something in my
code, but what is odd is that this error does NOT happen at anytime on our
test server or my local computer that uses the same application.

We test the application constantly on the test server, and no matter what,
the log never receives this error. It is possible that the reason for
this
is the higher load on our production servers. There are usually 85 - 100
users simultaneously hitting the box.

Here is an example of the new stuff that has been added since I have been
starting to get that error. (Prior to adding this code, I have never seen
this error in the log.)

Code:
Where is this code being executed from? You mentioned aspnet_wp, so, is this
being executed from an ASP.NET application?
Imports System.Threading

Public Sub PostDocument
Dim ThreadPost As New Thread(New ThreadStart(AddressOf
ExecutePost))
ThreadPost.Priority = ThreadPriority.Lowest
ThreadPost.Start()
End Sub

Public Sub ExecutePost()
Dim mut As Mutex = New Mutex
mut.WaitOne()
Try
Dim oHB As New HostBridgeLink(gsURL, "F400", UserID, Password,
Token)
oHB.ExecCmdWithData("PF10", "WEBIND=Y") : oHB.ExecCmd("PF8")
Catch ex As Exception
Why in the world would you want to eat every exception that this code might
possibly throw? Especially when you tell us you're getting crashes?

How about at least saving the exception details (from ex.ToString()) into
the event log or something?
Finally
mut.ReleaseMutex()
End Try
End Sub

All of the above code works correctly in test, and production too. I am
just
wondering if excessive use of any of the above at simultaneous times could
cause problems? Is there something I need to do to the server to handle
the
Threading? Am I forgetting another step that will cause a problem on the
server?


Have you looked at the performance counters to see how many threads are
being used?

John Saunders
Jul 21 '05 #2

P: n/a
> > "Where is this code being executed from? You mentioned aspnet_wp, so, is
this being executed from an ASP.NET application?"

-- yes, this code is being executed from an asp.net web application
"Why in the world would you want to eat every exception that this code might possibly throw? Especially when you tell us you're getting crashes? How
about at least saving the exception details (from ex.ToString()) into the
event log or something?"

-- I agree, that is a good suggestion, and I will add that to my code. I
may write the exception to a text file though so I can seperate the errors
from the event log.
"Have you looked at the performance counters to see how many threads are
being used?"

-- I am looking at the perfmon, but by looking at the thread monitor, I do
not know what to look for. I am not familiar with the type of settings that
are required on the server to handle threads from multiple users accessing
the same application simultaneously. I will keep an eye on the thread
monitor, and see if any of that information helps at all. Is there something
on the server I need to adjust based on the level of users that hit this
thread? Perhaps machine.config, or web.config in the application? Do you see
anything in my code that could cause such an error from occurring in the
application event log? Thank you

-Vincent
--------------------------------------------------------------------
"John Saunders" wrote:
"VinnieT" <Vi*****@discussions.microsoft.com> wrote in message
news:00**********************************@microsof t.com...
I have a load balanced system that consists of 3 production servers. There
are about 20 different applications that are used on these boxes. One of
my
applications in particular is used more than the others. Since updating 2
applications, I have had problems on the event log of the servers,
following
stopping of the aspnet_ws.exe process.

Something is causing the following error in the windows application event
log:

The description for Event ID ( 0 ) in Source ( .NET Runtime ) cannot be
found. The local computer may not have the necessary registry information
or
message DLL files to display messages from a remote computer. The
following
information is part of the event: .NET Runtime version 1.1.4322.2032-
Setup
Error: Failed to load resources from resource file

This is usually followed by the crashing of the aspnet_ws.exe process,
which
will crash all users that are in any application on the server. This
happens
about 3-8 times per day, at random times, with an absolute unknown cause
for
this.

I have searched all over the net for help on this error, and I cannot find
a
single answer that will fix this. I am thinking it is is something in my
code, but what is odd is that this error does NOT happen at anytime on our
test server or my local computer that uses the same application.

We test the application constantly on the test server, and no matter what,
the log never receives this error. It is possible that the reason for
this
is the higher load on our production servers. There are usually 85 - 100
users simultaneously hitting the box.

Here is an example of the new stuff that has been added since I have been
starting to get that error. (Prior to adding this code, I have never seen
this error in the log.)

Code:


Where is this code being executed from? You mentioned aspnet_wp, so, is this
being executed from an ASP.NET application?
Imports System.Threading

Public Sub PostDocument
Dim ThreadPost As New Thread(New ThreadStart(AddressOf
ExecutePost))
ThreadPost.Priority = ThreadPriority.Lowest
ThreadPost.Start()
End Sub

Public Sub ExecutePost()
Dim mut As Mutex = New Mutex
mut.WaitOne()
Try
Dim oHB As New HostBridgeLink(gsURL, "F400", UserID, Password,
Token)
oHB.ExecCmdWithData("PF10", "WEBIND=Y") : oHB.ExecCmd("PF8")
Catch ex As Exception


Why in the world would you want to eat every exception that this code might
possibly throw? Especially when you tell us you're getting crashes?

How about at least saving the exception details (from ex.ToString()) into
the event log or something?
Finally
mut.ReleaseMutex()
End Try
End Sub

All of the above code works correctly in test, and production too. I am
just
wondering if excessive use of any of the above at simultaneous times could
cause problems? Is there something I need to do to the server to handle
the
Threading? Am I forgetting another step that will cause a problem on the
server?


Have you looked at the performance counters to see how many threads are
being used?

John Saunders

Jul 21 '05 #3

P: n/a
"VinnieT" <Vi*****@discussions.microsoft.com> wrote in message
news:C9**********************************@microsof t.com...
> "Where is this code being executed from? You mentioned aspnet_wp, so,
> is this being executed from an ASP.NET application?"

-- yes, this code is being executed from an asp.net web application


You have to be very careful when using multiple threads in an ASP.NET
appliction. More careful than in other applications. This is because, if you
start a thread during a request, chances are that the request will have
completed before the thread completes. This may leave the thread accessing
invalid data and disposed objects.
> "Why in the world would you want to eat every exception that this code
> might possibly throw? Especially when you tell us you're getting crashes? How
about at least saving the exception details (from ex.ToString()) into the
event log or something?"

-- I agree, that is a good suggestion, and I will add that to my code. I
may write the exception to a text file though so I can seperate the errors
from the event log.


Take a look at System.Diagnostics.EventLog. You'll see that you can write
the errors under their own event source.
> "Have you looked at the performance counters to see how many threads
> are

being used?"

-- I am looking at the perfmon, but by looking at the thread monitor, I
do
not know what to look for. I am not familiar with the type of settings
that
are required on the server to handle threads from multiple users accessing
the same application simultaneously. I will keep an eye on the thread
monitor, and see if any of that information helps at all. Is there
something
on the server I need to adjust based on the level of users that hit this
thread? Perhaps machine.config, or web.config in the application? Do you
see
anything in my code that could cause such an error from occurring in the
application event log? Thank you

The performance counter I was talking about is simply the number of threads.

John Saunders
Jul 21 '05 #4

P: n/a
John,

I run this code over 100 times on our test servers and not one time did I
encounter this error. Evidentally, the code works correctly. The only
difference of our test server and our production server is the volume of
users that are executing the code simultaneously. If what you said is true,
what would I do to fix this? Is there a way to prevent destruction of
objects prior ot completion of the thread? Everywhere I look on the internet
and in books, my threading code is correct as is. Is there something I need
to do to fix this on the server or in the code?

I was considering calling Microsoft to help us fix this. This is a major
problem that has just recently started to happen, but I was hoping I could
get answers through this message board prior to calling up microsoft. Would
you suggest that I call Microsoft? Thank you -Vincent
"John Saunders" wrote:
"VinnieT" <Vi*****@discussions.microsoft.com> wrote in message
news:C9**********************************@microsof t.com...
> "Where is this code being executed from? You mentioned aspnet_wp, so,
> is

this being executed from an ASP.NET application?"

-- yes, this code is being executed from an asp.net web application


You have to be very careful when using multiple threads in an ASP.NET
appliction. More careful than in other applications. This is because, if you
start a thread during a request, chances are that the request will have
completed before the thread completes. This may leave the thread accessing
invalid data and disposed objects.
> "Why in the world would you want to eat every exception that this code
> might

possibly throw? Especially when you tell us you're getting crashes? How
about at least saving the exception details (from ex.ToString()) into the
event log or something?"

-- I agree, that is a good suggestion, and I will add that to my code. I
may write the exception to a text file though so I can seperate the errors
from the event log.


Take a look at System.Diagnostics.EventLog. You'll see that you can write
the errors under their own event source.
> "Have you looked at the performance counters to see how many threads
> are

being used?"

-- I am looking at the perfmon, but by looking at the thread monitor, I
do
not know what to look for. I am not familiar with the type of settings
that
are required on the server to handle threads from multiple users accessing
the same application simultaneously. I will keep an eye on the thread
monitor, and see if any of that information helps at all. Is there
something
on the server I need to adjust based on the level of users that hit this
thread? Perhaps machine.config, or web.config in the application? Do you
see
anything in my code that could cause such an error from occurring in the
application event log? Thank you

The performance counter I was talking about is simply the number of threads.

John Saunders

Jul 21 '05 #5

P: n/a
"VinnieT" <Vi*****@discussions.microsoft.com> wrote in message
news:F3**********************************@microsof t.com...
John,

I run this code over 100 times on our test servers and not one time did
I
encounter this error. Evidentally, the code works correctly.
Where a multithreaded program is concerned, the repeated success of a test
is not a good measure of code correctness. I've seem problems which
literally could not be reproduced except on 8-CPU systems! You could try
forever on a 4-CPU system and you would never reproduce the problem.
The only
difference of our test server and our production server is the volume of
users that are executing the code simultaneously.
Do they both use identical hardware? Especially number of CPUs and amount of
physical memory? If disk I/O is involved at all, do they both have the same
disks on the same disk controllers with similar levels of fragmentation?

Murphy wrote his famous Law to warn about multithreaded applications. Any
sequence of events which is not impossible will happen. Much of the "trick"
of programming threads involves making unfortunate things impossible through
synchronization.
If what you said is true,
what would I do to fix this? Is there a way to prevent destruction of
objects prior ot completion of the thread? Everywhere I look on the
internet
and in books, my threading code is correct as is. Is there something I
need
to do to fix this on the server or in the code?
Yes. Don't use Threading in ASP.NET applications.

Did I post this link before?

The ASP.NET Page Object Model
(http://msdn.microsoft.com/library/de...asp?frame=true)
And if I posted it, did you read it? An ASP.NET application follows a
fundamentally different lifecycle than, say, a Windows Forms application or
even a Windows Service. The HttpContext and all it references, the Page and
all it references do not belong to you. In particular, you do not have
control over their lifecycle. When the request is over, the resources
associated with it should be considered to be invalid.
I was considering calling Microsoft to help us fix this. This is a
major
problem that has just recently started to happen, but I was hoping I could
get answers through this message board prior to calling up microsoft.
Would
you suggest that I call Microsoft? Thank you -Vincent


No, I'd suggest that you either re-engineer your code with an understanding
of the ASP.NET page object model, or else move this troublesome code out of
ASP.NET. There's nothing wrong with an ASP.NET application queueing a
request to a server application which would have this multithreaded code in
it.

John Saunders

P.S. This may not actually be the source of your problem. Moving the
multithreaded code out to a separate process would be one way to confirm
this. If it works in a separate process, then perhaps the problem was the
process it was running in (aspnet_wp).

Another way would be to have the ASP.NET code wait for the completion of all
the threads. This won't work in production, but might be a useful diagnostic
technique. If it works when the page waits for completion, then maybe the
problem was that the code requires the page in order to work correctly.
Jul 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.