【发布时间】:2011-02-01 23:01:37
【问题描述】:
我在 vb.net 中开发了一个应用程序。我在我的解决方案中使用我作为不同项目的一部分构建的 dll。出于某种原因,我无法使用构建为“发布”版本的 dll 获得应用程序的全部功能,但如果将 dll 构建为“调试”版本(这是一个完全不同的问题),它确实可以工作。我现在没有问题,使用调试版本。但是,我遇到的问题是我正在尝试将应用程序部署到另一个系统,如果我部署 dll 的调试版本,我会收到运行时错误(见下文)。我安装了 .net 框架。我只是想知道必须安装什么才能让我使用新系统的调试版本?
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>
<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.
【问题讨论】:
-
我在传递 APP 或 DLL 的调试版本时没有遇到问题。 “调试”主要是指添加“额外”的项目,而不是必需操作。上面的错误看起来更像真实的东西。让我们看看您的 VB 代码在该行号周围是什么样子。
-
这是从 VS2008 构建的吗?如果是这样,您的目标是哪个框架,2.0、3.0 还是 3.5?如果后两者中的任何一个都安装在另一台机器上?此外,您的问题可能不是远程机器不会运行您的调试版本,而是调试版本是唯一的工作版本,它只能在您的机器上运行。我会先解决调试/发布问题。否则,当你真的手臂骨折时,你可能会通过拜访教练来解决“我的网球技术不好”的问题。
-
我正在运行 VS 2008。当我尝试通过调用已开发的 dll 中提供的功能打开文件时,似乎发生了错误。顺便说一句,我的目标是 2.0 框架,并在两台机器上都安装了它。
-
所以这是一个有趣的更新,因为我正在尝试解决为什么我的应用程序与底层 dll 的调试版本一起工作而不能与使用的底层 dll 的发布版本一起工作的问题.如果我更改调试版本的一个配置项并使用生成的 dll,那么该功能将不起作用。如果我把它改回来,它确实有效。因此,如果我更改:“配置属性”=>“C/C++”=>“代码生成”=>“运行时库从“多线程调试 DLL (/MDd)”到“多线程 DLL (/MD) " 那么我正在寻找的功能不再有效。
标签: vb.net visual-studio visual-studio-2008 deployment