For the life of me I cannot figure out why it is throwing a NullReferenceException. I thought it was a case sensitive problem.
Wait a minute. Just before hitting send I did another test. If I don't run in debug mode it works fine..no exceptions. If I run in debug mode and put a breakpoint on the tmpStr and/or tmpDbl lines I get the exception thrown. Any ideas why it would throw an exception in debug mode but not otherwise?
Thank You
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Did some more testing and the error seems to be in:
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="Nini"
StackTrace:
at Nini.Ini.IniWriter.Dispose(Boolean disposing) in R:\Software Development\CSharp\Nini\Source\Ini\IniWriter.cs:line 211
at Nini.Ini.IniWriter.Finalize() in R:\Software Development\CSharp\Nini\Source\Ini\IniWriter.cs:line 228
I have to look at why it is trying to close an IniWriter when I didn't think I opened one.
Very confused.
Thanks Again
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm in the same situation as you. Just started with Nini, using C# and MSVC 2005, and get a null object reference on program exit (Nini.Ini.IniWriter.Dispose) if I run in debug mode and place a breakpoint in the Nini using code somewhere. Debug mode with no breakpoints is OK. Release mode is OK.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am new to Nini and am starting off with a simple test program in VS 2005 and C#. I have an INI file that exists with the following info in it:
[DAQConfigParameters]
Ch4X2=0
My simple program has the following code, but it keep throwing a NullReferenceException:
IniConfigSource iCfg =
new IniConfigSource(@"C:\whatever\test.ini");
iCfg.CaseSensitive = false;
tmpStr = iCfg.Configs["DAQConfigParameters"].GetString("Ch4X2");
tmpDbl = iCfg.Configs["DAQConfigParameters"].GetDouble("Ch4X2");
Console.Out.WriteLine("Read {0:f1}",tmpDbl);
For the life of me I cannot figure out why it is throwing a NullReferenceException. I thought it was a case sensitive problem.
Wait a minute. Just before hitting send I did another test. If I don't run in debug mode it works fine..no exceptions. If I run in debug mode and put a breakpoint on the tmpStr and/or tmpDbl lines I get the exception thrown. Any ideas why it would throw an exception in debug mode but not otherwise?
Thank You
Did some more testing and the error seems to be in:
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="Nini"
StackTrace:
at Nini.Ini.IniWriter.Dispose(Boolean disposing) in R:\Software Development\CSharp\Nini\Source\Ini\IniWriter.cs:line 211
at Nini.Ini.IniWriter.Finalize() in R:\Software Development\CSharp\Nini\Source\Ini\IniWriter.cs:line 228
I have to look at why it is trying to close an IniWriter when I didn't think I opened one.
Very confused.
Thanks Again
I'm in the same situation as you. Just started with Nini, using C# and MSVC 2005, and get a null object reference on program exit (Nini.Ini.IniWriter.Dispose) if I run in debug mode and place a breakpoint in the Nini using code somewhere. Debug mode with no breakpoints is OK. Release mode is OK.
This was fixed. Grab the latest version of the source code:
https://sourceforge.net/tracker/index.php?func=detail&aid=1519978&group_id=110719&atid=657268