简体   繁体   中英

Visual Studio 2008 - Program exits immediately with F5 (start debugging)

I'm having a strange issue with Visual Studio where if I start debugging it exits immediately. This started happening after changing the assembly name in the project properties. If I change the assembly name back to the previous name then the program runs fine. How can I fix this?

Here is the output when running after changing the assembly name:

'SerialDeviceMaintenanceUtility.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SerialDeviceMaintenanceUtility.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\9.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SerialDeviceMaintenanceUtility.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SerialDeviceMaintenanceUtility.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SerialDeviceMaintenanceUtility.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SerialDeviceMaintenanceUtility.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\9.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SerialDeviceMaintenanceUtility.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\9.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SerialDeviceMaintenanceUtility.vshost.exe' (Managed): Loaded 'C:\DEV\SerialDeviceMaintenanceUtility\SerialDeviceMaintenanceUtility\bin\Release\SerialDeviceMaintenanceUtility.vshost.exe', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SerialDeviceMaintenanceUtility.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SerialDeviceMaintenanceUtility.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Xml.Linq\3.5.0.0__b77a5c561934e089\System.Xml.Linq.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SerialDeviceMaintenanceUtility.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Data.DataSetExtensions\3.5.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SerialDeviceMaintenanceUtility.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SerialDeviceMaintenanceUtility.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SerialDeviceMaintenanceUtility.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\WindowsBase\3.0.0.0__31bf3856ad364e35\WindowsBase.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SerialDeviceMaintenanceUtility.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\PresentationCore\3.0.0.0__31bf3856ad364e35\PresentationCore.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SerialDeviceMaintenanceUtility.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\PresentationFramework\3.0.0.0__31bf3856ad364e35\PresentationFramework.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'SerialDeviceMaintenanceUtility.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\WindowsFormsIntegration\3.0.0.0__31bf3856ad364e35\WindowsFormsIntegration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The thread 0xd80 has exited with code 0 (0x0).
The thread 0x174 has exited with code 0 (0x0).
'SerialDeviceMaintenanceUtility.vshost.exe' (Managed): Loaded 'C:\DEV\SerialDeviceMaintenanceUtility\SerialDeviceMaintenanceUtility\bin\Release\SerialDeviceMaintenanceUtility.exe', Symbols loaded.
The program '[1632] SerialDeviceMaintenanceUtility.vshost.exe: Managed' has exited with code -1073741819 (0xc0000005).

Note: Path names above have been abbreviated to hide organization specific naming.

我会在程序集名称更改(清理和构建)后重建您的解决方案。

I've struggled to disable this 'turbo-exit' feature of VS2008 for months. It seems related to the XML files in my project. I had it fixed at one point, but then I got a new machine from IT and the problem was introduced again.

Check out Microsoft KB957912.

Have you tried setting the startup object in the application settings?

Also, have you tried to set a Breakpoint at the earlymost available location (In a WPF Application, that would be your App.xaml.cs)? Sometimes you just don't realize when stuff like InitializeComponent() fails...

Last but not least, do you use Reflection in combination with the old Assembly Name (as a string)? Try searching your project for anything

I'm just guessing, this is kind of hard to tell given only the little information you provide :(

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM