473,402 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

NullReferenceException in Unknown Module

Hi,

Once in a while my application throws an NullReferenceException at startup,
however it appears to be occurring in an unknown module. If I debug it and
ask to 'break', then there is no source code available (I am running in Debug
mode of course).

What could be the cause of this? Can someone shed some light on this matter?

Kind regards,
--
Tom Tempelaere.
Oct 26 '05 #1
5 3030
Hi,

I've investigated a little further, and I think that the exception is thrown
from or near the System.Runtime.Remoting dll. I've checked this by setting
breakpoints once this NullReferenceException occurs, and pressing continue.
The point where execution breaks is right after a call to
RemotingServices.Connect.

This problem occurs once in a while (unpredictable), but doesn't happen at
all if I put a breakpoint at the line where the connection is made using
RemotingServices.Connect and continue execution from there. I suspect a
timing/sync problem when loading the System.Runtime.Remoting assembly dll
although this is just a wild guess.

I'm running .NET 1.1.4322/SP1 on a WinXp-Pro 5.1.2600/SP1 platform. The
program is compiled using C# on MSDE 2003 7.1.3088.

The code snippet where the problem occurs follows. After pressing continue
for the NullReferenceException and setting breakpoints, execution stops at
the third line where I cast the remoted object reference to the interface,
right after the call to RemotingServices.Connect. So my guess is that the
exception is triggered somewhere around the call to RemotingServices.Connect.
Since the NullReferenceException occurs in an unknown module my (wild) guess
is that loading the Remoting assembly produces the problem (this is the first
call to the Remoting library from my program).

<code>
string connectionStr="tcp://localhost:9123/MyRemoteObj";

object objRef = RemotingServices.Connect (
typeof( IMyItf ),
connectionStr
); // <-- NullReferenceException here???

IMyItf myRemoteObj = objRef as IMyItf;
</code>

Kind regards,
--
Tom Tempelaere.
"TT (Tom Tempelaere)" wrote:
Hi,

Once in a while my application throws an NullReferenceException at startup,
however it appears to be occurring in an unknown module. If I debug it and
ask to 'break', then there is no source code available (I am running in Debug
mode of course).

What could be the cause of this? Can someone shed some light on this matter?

Kind regards,
--
Tom Tempelaere.

Oct 26 '05 #2
> Once in a while my application throws an NullReferenceException at startup,
however it appears to be occurring in an unknown module.


Search the news groups for
"unknown module"
for some interesting reading (use the quotes to limit the responses)

Oct 26 '05 #3
Hi AMercer,

I've done that and indeed found some things, but none that really applies to
my specific problem. The only thing I could up with is that it could have
something to do with .NET SP1. The code ran smoothly without problems for the
past year running .NET SP0, the problems are very recent and since we
recently upgraded to SP1 that could have something to do with it.

Also people in the field claim they don't have the problem I'm stating. I
now notice that I only have this problem from the debugger...

Kind regards,
--
Tom Tempelaere.
"AMercer" wrote:
Once in a while my application throws an NullReferenceException at startup,
however it appears to be occurring in an unknown module.


Search the news groups for
"unknown module"
for some interesting reading (use the quotes to limit the responses)

Oct 27 '05 #4
> Also people in the field claim they don't have the problem I'm stating. I
now notice that I only have this problem from the debugger...
I believe it is a bug in the ide/debugger. When you have a situation that
exhibits the problem, try running the exe without using the ide/debugger. My
prediction is that you will never be able to recreate it that way. It is
nasty (assuming you have been seeing what I have seen) because it is rare and
intermittent.
The only thing I could up with is that it could have
something to do with .NET SP1.


I don't think sp1 has anything to do with it. Just my opinion, and the big
assumption is that you are seeing the same problem I have seen from time to
time.

Good luck.
Oct 27 '05 #5
"AMercer" wrote:
Also people in the field claim they don't have the problem I'm stating. I
now notice that I only have this problem from the debugger...


I believe it is a bug in the ide/debugger. When you have a situation that
exhibits the problem, try running the exe without using the ide/debugger. My
prediction is that you will never be able to recreate it that way. It is
nasty (assuming you have been seeing what I have seen) because it is rare and
intermittent.
The only thing I could up with is that it could have
something to do with .NET SP1.


I don't think sp1 has anything to do with it. Just my opinion, and the big
assumption is that you are seeing the same problem I have seen from time to
time.

Good luck.


Hi AMercer,

I get the same feeling now. I've tried running it outside the debugger
several times and couldn't reproduce it. Plus the fact that the program
doesn't have that problem in the field.

Thanks,
--
Tom Tempelaere.

Oct 27 '05 #6

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

Similar topics

0
by: majed | last post by:
hi I use VS.NET 2003 every time i try to start (debug,Release) any application i get the folowing exceptio System.NullreferenceException occurred in UnKnown Modul befor the form showsup on the...
1
by: Dan | last post by:
I'm experiencing a very strange problem with vsnet2003 and the latest dotnet 1.1 sp1. I have a C# winforms project using Crystal Reports for .NET and accessing a database which worked fine before...
3
by: Me | last post by:
I'm getting a NullReferenceException in Unknown Module when I follow the below steps to create a simple NotifyIcon app that creates the context menu on the fly(see a little analysis after the...
0
by: Rei Miyasaka via DotNetMonster.com | last post by:
When I create a managed C++ class library (user control to be exact) which I use from a C# Windows application, it gives me a NullReferenceException in Unknown Module right as I induce a GC. ...
0
by: theta | last post by:
Hi everyone. I'm a .NET newbie and I have a problem calling DLL functions from vb .net. I'm trying to access Howl's Rendezvous.dll (www.porchdogsoft.com/products/howl/) from managed code. I was...
2
by: R. van der Welle | last post by:
Hi All, I am upgrading my app (working well with VB6) to VB.NET. It sends MIDI messages using the API multimedia winmm.dll . These functions are declared: Public Declare Function timeSetEvent...
5
by: TT (Tom Tempelaere) | last post by:
Hi, Once in a while my application throws an NullReferenceException at startup, however it appears to be occurring in an unknown module. If I debug it and ask to 'break', then there is no source...
6
by: delusion7 | last post by:
I keep getting this error and/or similar errors. I am very new to mysql and php. "PHP Warning: Unknown(): Unable to load dynamic library './php_mysqli.dll' - The specified module could not be...
2
by: Martin | last post by:
Hi All! I'm developing an app in VB2005 for Windows Mobile 5.0 (compact framework). I'm a beginner in VB.Net after years of programming in VB6 and its predecessors. Now I ran into a...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.