Deploying a debug version of a vb.net app
I have developed an application in vb.net. I use a dll that I build as part of a different project in my solution. For some reason I don't get the full functionality of my application with the dll built as a "release" version, but it does work if the dll is built as a "debug" version (that's a whole different problem). I don't have a problem, for now, using the debug version. However, the problem I'm having is I am trying to deploy the application to another system and if I deploy the debug version of the dll I get a runtime error (see below). I have the .net Framework installed. I'm just wondering what has to be installed in order to allow me to use the debug version of the new system?
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at tocapp.Form1.Form1_Load(Object sender, EventArgs e) in C:\Documents and Settings\gregh\My Documents\Visual Studio 2005\Projects\TOCApp2\TOCApp2\Form1.vb:line 104
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3607 (GDR.050727-3600)
CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
tocapp
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/Sparnet/tocapp.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
SparnetMapControl
Assembly Version: 0.0.0.0
Win32 Version: 0.0.0.0
CodeBase: file:///C:/Program%20Files/Sparnet/SparnetMapControl.DLL
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Oracle.DataAccess
Assembly Version: 10.2.0.100
Win32 Version: 10.2.0.100
CodeBase: file:///C:/WINDOWS/assembly/GAC/Oracle.DataAccess/10.2.0.100__89b483f429c47342/Oracle.DataAccess.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<开发者_StackOverflow中文版;system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
It looks like your "underlying dll" might have a bug that is vanishing as soon as you do a debug build; There are many potential causes for this, ranging from thread synchronisation issues (that vanish when DebugWrite()
calls get removed from Release builds) right the way through to memory corruptions from poorly initiated memory.
"if I change: "Configuration Properties" => "C/C++" => "Code Generation" => "Runtime Library From "Multi-Threaded Debug DLL (/MDd)" to "Multi-Threaded DLL (/MD)" then the functionality I am looking for no longer works"
I know this is little old post, but might be usefull to someone.
It seams like linking problem before anything else. you can't mix libriries for debug with project that does not include debug and also make sure that both dependency libraries are of same build type. Both libraries and project must be have both same building properties: debug/multithreaded project must link with debug/multithreaded libraries, and release/multithreaded project must link with release/multithreaded libraries.
Make sure this is the case in project properties.
also you can't deploy debug version of c++ project since it has to be release. this is since target OS always have release version of c++ runtime libs ;) debug version of c++ dlls is only installed with VS or probably also with some other development environments.
also notice c++ is specific about c++ runtime libs, app without specific manifest file where you have specified range for c++ runtime libs version in most cases explicitly targets c++ runtime libs version against which you have built your app. so make sure you deploy c++ runtime libs redistributable of same version with your app (its ussually around 3mb no big trouble these days).
or link everything statically (larger app, bigger memory foot, hell to setup environment, but no need for shared c++ runtime libs - this is main reason I like deplhi == no dependency).
精彩评论