473,549 Members | 2,708 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.NullRefe rence exception

Hi All

I have a windows forms Application (SAM) in vb.net 2008 using .net framework
V2

One and only one customer out of 30 customers is getting errors daily where
they have to close and restart my application, sometimes several times a day

The customer has XP Home SP2

The event viewer shows the following although not always in the same
sequence

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48d969a4, P4 sam, P5 1.0.0.0,
P6 48d969a4, P7 5, P8 0, P9 system.nullrefe renceexception, P10 NIL.

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48d969a4, P4
microsoft.visua lbasic, P5 8.0.0.0, P6 471ee7ea, P7 86, P8 a2, P9
system.componen tmodel.win32, P10 NIL.

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48eea25c, P4
microsoft.visua lbasic, P5 8.0.0.0, P6 471ee7ea, P7 5e, P8 1e1, P9
34ssps20bdj3nj0 wmit5kamzhvglfz cc, P10 NIL.

Hanging application SAM.exe, version 1.0.0.0, hang module hungapp, version
0.0.0.0, hang address 0x00000000.

I am lost as to what may be causing it and like I said it only happens to
the 1 customer

Any ideas what it could be and any ideas on how to troubleshoot it further
to find the exact cause?

Regards
Steve

Oct 16 '08 #1
6 4372
"Steve" <ga*****@nospam .nospamschrieb
Hi All

I have a windows forms Application (SAM) in vb.net 2008 using .net
framework V2

One and only one customer out of 30 customers is getting errors
daily where they have to close and restart my application, sometimes
several times a day

The customer has XP Home SP2

The event viewer shows the following although not always in the same
sequence

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48d969a4, P4 sam, P5
1.0.0.0, P6 48d969a4, P7 5, P8 0, P9 system.nullrefe renceexception,
P10 NIL.

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48d969a4, P4
microsoft.visua lbasic, P5 8.0.0.0, P6 471ee7ea, P7 86, P8 a2, P9
system.componen tmodel.win32, P10 NIL.

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48eea25c, P4
microsoft.visua lbasic, P5 8.0.0.0, P6 471ee7ea, P7 5e, P8 1e1, P9
34ssps20bdj3nj0 wmit5kamzhvglfz cc, P10 NIL.

Hanging application SAM.exe, version 1.0.0.0, hang module hungapp,
version 0.0.0.0, hang address 0x00000000.

I am lost as to what may be causing it and like I said it only
happens to the 1 customer

Any ideas what it could be and any ideas on how to troubleshoot it
further to find the exact cause?

How does you exception handling code look like?
Armin
Oct 16 '08 #2
On Oct 16, 1:53*pm, "Steve" <ga63...@nospam .nospamwrote:
Hi All

I have a windows forms Application (SAM) in vb.net 2008 using .net framework
V2

One and only one customer out of 30 customers is getting errors daily where
they have to close and restart my application, sometimes several times a day

The customer has XP Home SP2

The event viewer shows the following although not always in the same
sequence

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48d969a4, P4 sam, P5 1.0.0.0,
P6 48d969a4, P7 5, P8 0, P9 system.nullrefe renceexception, P10 NIL.

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48d969a4, P4
microsoft.visua lbasic, P5 8.0.0.0, P6 471ee7ea, P7 86, P8 a2, P9
system.componen tmodel.win32, P10 NIL.

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48eea25c, P4
microsoft.visua lbasic, P5 8.0.0.0, P6 471ee7ea, P7 5e, P8 1e1, P9
34ssps20bdj3nj0 wmit5kamzhvglfz cc, P10 NIL.

Hanging application SAM.exe, version 1.0.0.0, hang module hungapp, version
0.0.0.0, hang address 0x00000000.

I am lost as to what may be causing it and like I said it only happens to
the 1 customer

Any ideas what it could be and any ideas on how to troubleshoot it further
to find the exact cause?

Regards
Steve
First try to have "try-catch" exception handling blocks as many as
possible in your project to catch "possible" exceptions, then based on
your description, make sure you have a exception block in form_load
and form_formclosed and formClosing events like:

' When the form is loaded
Private Sub Form1_Load(.... .) Handles MyBase.Load

Try

' Do the stuff

Catch ex As Exception
Msgbox(ex.Messs age)

End Try

End Sub

....do the same for form's FormClosing and FormClosed events if your
application is not console one.

Additionaly, related to "System.NullRef erence" exception, presumably,
your variable may have no value assigned to the referenced object
anylonger as the reason of exception. Or the object is being
instantianted improperly after app restart.

Just it was a guess,

Onur Güzel
Oct 16 '08 #3
The first step would be to have a callstack so that you can see where it
happens. You could start by adding a global exception handler (if not
already done) in the appplication that would store somewhere exception
details to ease further analysis...

---
Patrice

"Steve" <ga*****@nospam .nospama écrit dans le message de groupe de
discussion : uw************* *@TK2MSFTNGP03. phx.gbl...
Hi All

I have a windows forms Application (SAM) in vb.net 2008 using .net
framework V2

One and only one customer out of 30 customers is getting errors daily
where they have to close and restart my application, sometimes several
times a day

The customer has XP Home SP2

The event viewer shows the following although not always in the same
sequence

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48d969a4, P4 sam, P5
1.0.0.0, P6 48d969a4, P7 5, P8 0, P9 system.nullrefe renceexception, P10
NIL.

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48d969a4, P4
microsoft.visua lbasic, P5 8.0.0.0, P6 471ee7ea, P7 86, P8 a2, P9
system.componen tmodel.win32, P10 NIL.

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48eea25c, P4
microsoft.visua lbasic, P5 8.0.0.0, P6 471ee7ea, P7 5e, P8 1e1, P9
34ssps20bdj3nj0 wmit5kamzhvglfz cc, P10 NIL.

Hanging application SAM.exe, version 1.0.0.0, hang module hungapp, version
0.0.0.0, hang address 0x00000000.

I am lost as to what may be causing it and like I said it only happens to
the 1 customer

Any ideas what it could be and any ideas on how to troubleshoot it further
to find the exact cause?

Regards
Steve
Oct 16 '08 #4
Hi All

Thanks for the responses

I have try/catch blocks in most of my routines

I also have a code in MyApplication_U nhandledExcepti onroutine, which doesn't
fire (see below)

'writes unhandled exceptions to my log file

mymsgbox(e.Exce ption.Message & vbCr & e.Exception.Inn erException.ToS tring)

If e.Exception.Mes sage.Length 200 Then

savetolog("Auto ", e.Exception.Mes sage.Substring( 0, 199))

Else

savetolog("Auto ", e.Exception.Mes sage)

End If

The screen they get when the error occurs is not the usual .net screen
showing the error details, but the Microsoft screen with send report / don't
send buttons

Not sure if this makes a difference

Regards

Steve

"Steve" <ga*****@nospam .nospamwrote in message
news:uw******** ******@TK2MSFTN GP03.phx.gbl...
Hi All

I have a windows forms Application (SAM) in vb.net 2008 using .net
framework V2

One and only one customer out of 30 customers is getting errors daily
where they have to close and restart my application, sometimes several
times a day

The customer has XP Home SP2

The event viewer shows the following although not always in the same
sequence

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48d969a4, P4 sam, P5
1.0.0.0, P6 48d969a4, P7 5, P8 0, P9 system.nullrefe renceexception, P10
NIL.

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48d969a4, P4
microsoft.visua lbasic, P5 8.0.0.0, P6 471ee7ea, P7 86, P8 a2, P9
system.componen tmodel.win32, P10 NIL.

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48eea25c, P4
microsoft.visua lbasic, P5 8.0.0.0, P6 471ee7ea, P7 5e, P8 1e1, P9
34ssps20bdj3nj0 wmit5kamzhvglfz cc, P10 NIL.

Hanging application SAM.exe, version 1.0.0.0, hang module hungapp, version
0.0.0.0, hang address 0x00000000.

I am lost as to what may be causing it and like I said it only happens to
the 1 customer

Any ideas what it could be and any ideas on how to troubleshoot it further
to find the exact cause?

Regards
Steve

Oct 16 '08 #5
Just a shot in the dark, but can the user run your app as the administrator
successfully? Often this can be caused by some assumption of full
permissions somewhere in code. Things like reading or writing registry keys
may work 9 out of 10 times (or 29 out of 30 in your case).

"Steve" <ga*****@nospam .nospamwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Hi All

Thanks for the responses

I have try/catch blocks in most of my routines

I also have a code in MyApplication_U nhandledExcepti onroutine, which
doesn't fire (see below)

'writes unhandled exceptions to my log file

mymsgbox(e.Exce ption.Message & vbCr & e.Exception.Inn erException.ToS tring)

If e.Exception.Mes sage.Length 200 Then

savetolog("Auto ", e.Exception.Mes sage.Substring( 0, 199))

Else

savetolog("Auto ", e.Exception.Mes sage)

End If

The screen they get when the error occurs is not the usual .net screen
showing the error details, but the Microsoft screen with send report /
don't send buttons

Not sure if this makes a difference

Regards

Steve

"Steve" <ga*****@nospam .nospamwrote in message
news:uw******** ******@TK2MSFTN GP03.phx.gbl...
>Hi All

I have a windows forms Application (SAM) in vb.net 2008 using .net
framework V2

One and only one customer out of 30 customers is getting errors daily
where they have to close and restart my application, sometimes several
times a day

The customer has XP Home SP2

The event viewer shows the following although not always in the same
sequence

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48d969a4, P4 sam, P5
1.0.0.0, P6 48d969a4, P7 5, P8 0, P9 system.nullrefe renceexception, P10
NIL.

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48d969a4, P4
microsoft.visu albasic, P5 8.0.0.0, P6 471ee7ea, P7 86, P8 a2, P9
system.compone ntmodel.win32, P10 NIL.

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48eea25c, P4
microsoft.visu albasic, P5 8.0.0.0, P6 471ee7ea, P7 5e, P8 1e1, P9
34ssps20bdj3nj 0wmit5kamzhvglf zcc, P10 NIL.

Hanging application SAM.exe, version 1.0.0.0, hang module hungapp,
version 0.0.0.0, hang address 0x00000000.

I am lost as to what may be causing it and like I said it only happens to
the 1 customer

Any ideas what it could be and any ideas on how to troubleshoot it
further to find the exact cause?

Regards
Steve

Oct 16 '08 #6
Hello Steve,

If an exception goes unhandled in a .NET 2.0 application, it will use
Windows Error Reporting to send a report automatically. Although we have
MyApplication_U nhandledExcepti onroutine in the application (according to
your code snippet, I think it¡¯s added through the
Application.Thr eadException event) and add try/catch in most of the
routines, there is actually another source of UnhandledExcept ion:

¡°AppDomain.Unh andledException ¡±

Application.Thr eadException is used to add the event handler for handling UI
thread exceptions. AppDomain.Unhan dledException adds the event handler for
handling non-UI thread exception. In other words, if an exception is thrown
from a non-UI thread, Application.Thr eadException is not able to capture it,
and it will go to the ¡°Windows Error Report¡± dialog. In addition, we need
to call
Application.Set UnhandledExcept ionMode(Unhandl edExceptionMode .CatchException );
to set the unhandled exception mode to force all windows form error to go
through our handler. A typical example is:

SecurityPermiss ion(SecurityAct ion.Demand, Flags =
SecurityPermiss ionFlag.Control AppDomain)]
public static void Main(string[] args)
{
// Add the event handler for handling UI thread exceptions to the event.
Application.Thr eadException += new
ThreadException EventHandler(Er rorHandlerForm. Form1_UIThreadE xception);

// Set the unhandled exception mode to force all Windows Forms errors to
go through
// our handler.
Application.Set UnhandledExcept ionMode(Unhandl edExceptionMode .CatchException );

// Add the event handler for handling non-UI thread exceptions to the
event.
AppDomain.Curre ntDomain.Unhand ledException +=
new
UnhandledExcept ionEventHandler (CurrentDomain_ UnhandledExcept ion);

// Runs the application.
Application.Run (new ErrorHandlerFor m());
}

private static void CurrentDomain_U nhandledExcepti on(object sender,
UnhandledExcept ionEventArgs e)
{
try
{
Exception ex = (Exception)e.Ex ceptionObject;
// dump the call stack here

// Create an EventLog instance and assign its source.
EventLog myLog = new EventLog();
myLog.Source = "ThreadExceptio n";
myLog.WriteEntr y(errorMsg + ex.Message + "\n\nStack Trace:\n" +
ex.StackTrace);
}
catch (Exception exc)
{
try
{
MessageBox.Show ("Fatal Non-UI Error",
"Fatal Non-UI Error. Could not write the error to the event
log. Reason: "
+ exc.Message, MessageBoxButto ns.OK, MessageBoxIcon. Stop);
}
finally
{
Application.Exi t();
}
}
}

(See MSDN article:
http://msdn.microsoft.com/en-us/libr...ptionmode.aspx)

With the above code, we can dump the call stack of the unhandled exception
in the exception handler, and see how the exception is thrown.

Regards,
Jialiang Ge (ji****@online. microsoft.com, remove ¡®online.¡¯)
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/...tance&ln=en-us.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

"Steve" <ga*****@nospam .nospamwrote in message
news:uw******** ******@TK2MSFTN GP03.phx.gbl...
Hi All

I have a windows forms Application (SAM) in vb.net 2008 using .net
framework V2

One and only one customer out of 30 customers is getting errors daily
where they have to close and restart my application, sometimes several
times a day

The customer has XP Home SP2

The event viewer shows the following although not always in the same
sequence

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48d969a4, P4 sam, P5
1.0.0.0, P6 48d969a4, P7 5, P8 0, P9 system.nullrefe renceexception, P10
NIL.

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48d969a4, P4
microsoft.visua lbasic, P5 8.0.0.0, P6 471ee7ea, P7 86, P8 a2, P9
system.componen tmodel.win32, P10 NIL.

EventType clr20r3, P1 sam.exe, P2 1.0.0.0, P3 48eea25c, P4
microsoft.visua lbasic, P5 8.0.0.0, P6 471ee7ea, P7 5e, P8 1e1, P9
34ssps20bdj3nj0 wmit5kamzhvglfz cc, P10 NIL.

Hanging application SAM.exe, version 1.0.0.0, hang module hungapp, version
0.0.0.0, hang address 0x00000000.

I am lost as to what may be causing it and like I said it only happens to
the 1 customer

Any ideas what it could be and any ideas on how to troubleshoot it further
to find the exact cause?

Regards
Steve

Oct 17 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1556
by: sergi | last post by:
Hi there, I am getting a System.NullReference exception when calling an unmanaged method CreateClassEnumerator. I am really new to Interop, so that I am having trouble finding out a solution. The code is the following : <code> using System;
2
1773
by: Larry Re | last post by:
I've written a small C# app which appears to work perfectly except for the fact that I get a NullReference exception when I close the form using the red 'X' in the upper right hand corner of the form. Any ideas on why this might be happening? Please remove 'X's from email address to reply
5
4015
by: Vitling | last post by:
For no apparent reason, a NullReference exception is thrown in system.dll (System.Net.Sockets.OverlappedAsyncResult.CompletionPortCallback). Since I only get a disassembly from Visual Studio, it is almost impossible to figure out what causes this. I've tried adding: AppDomain.CurrentDomain.UnhandledException += new...
4
4213
by: Bhavya Shah | last post by:
Hello, I am facing a very strange problem in my application. I have a form on which I select a path. I open the FolderBrowserDialog for path selection. Once the path is selected I press a button "Search" for searching documents on that path. This search process runs in a separate thread so that I can search for multiple paths simultaneously....
0
1278
by: studio60podcast | last post by:
I'm defining the ItemUpdating event for a DetailsView control, but when I try to access the e.NewValues collection, it's throwing a NULLReference exception. Any thoughts? <asp:DetailsView id="dvConsultantDetails" runat="server" GridLines="none" CssClass="textBlue12" AutoGenerateRows="false" DefaultMode="Edit"...
1
1476
by: Rama Jayapal | last post by:
i have written the following code to call a method in a class like in the aspx.cs page List<string> surls = new List<string>(); Cweb.GetMainUrls(document,ref surls); Response.Write(surls); in the Cweb Class page the coding is like
4
2067
by: yogarajan | last post by:
hi i had developed pop3 Account mail view in my web page but i got error in (System.NullReference Exception: Object reference not set) NetStrm.Write(szData, 0, szData.Length); - this line ///my code start here (cs file) using System; using System.Data;
0
1087
by: =?Utf-8?B?RGlzcEV2ZW50QWR2aXNlIGZhaWxzIHdpdGggMHg4 | last post by:
Hi, I have a beginner's question and I'm not even sure whether it's an asp question, an Exchange server question or an x64 question... I've been experimenting with HttpModules. I want to use one in an OWA web site to override form authentication, with Exchange Server 2007. I keep getting NullReference exception, even though I commented all the...
2
2971
by: ganeshvkl | last post by:
i got error " An unhandled exception of type 'System.NullReferenceException' occurred in system.data.dll " when i run my VB.net 2003 with Sqlserver 2000 server program , the same program is working fine in Other PCs .. can someone give solve my Problem? Thanx in Adv Regards ganesh
0
7524
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7720
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7475
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7812
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6048
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3483
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1944
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1061
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
766
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.