473,382 Members | 1,745 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,382 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 3023
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.