GoldRunner

I have a problem with starting my .NET Framework 2.0 application in particular PC environment. Previously it was successfully working on this PC, but some time it stops starting. I tested my app on several other machnies with similar configuration and it was successfully working. I was trying to repair .NET Installation, but it didn't help, so i would like to ask
you help this problem, because i suppose that it could be related with some patch installation on my machine.

Problem occures during the .NET application loads Mixed Mode Assply: it throws FileNotFoundException during Application.Run: "The system cannot find the file specified. (Exception from HRESULT: 0x80070002)". All other .NET applications that don't use mixed mode assemplie, work successfully. I investigated that problem is related to the mode of one of my assemlies is built with C++/CLI - it is "Common Language Runtime Support (/clr)", when this option is switched to "Pure MSIL Common Language Runtime Support (/clr:pure)", this failure disappears, but i have some other problems in my application, which requires mixed mode execution.

Here the Visual Studio log output, that shows how error exactly occures:

'MechEditor.exe': Loaded 'D:\My Documents\My Programms\Personal Progs\NET 1-2.0\Mech Studio .NET 2\Mech Editor\bin\Debug\MechEditor.exe', No native symbols in symbol file.
'MechEditor.exe': Loaded 'C:\WINNT\system32\ntdll.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\system32\mscoree.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\system32\kernel32.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\system32\advapi32.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\system32\rpcrt4.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\system32\shlwapi.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\system32\gdi32.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\system32\user32.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\system32\msvcrt.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\system32\imm32.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\system32\lpk.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\system32\usp10.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700\msvcr80.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\system32\shell32.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\system32\comctl32.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Culture.dll', No symbols loaded.
'MechEditor.exe': Unloaded 'C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Culture.dll'
'MechEditor.exe': Loaded 'C:\WINNT\assembly\NativeImages_v2.0.50727_32\mscorlib\04b23941826c9249aa45e6ea55ca5932\mscorlib.ni.dll', No symbols loaded.
'MechEditor.exe' (Managed): Loaded 'C:\WINNT\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.
'MechEditor.exe': Loaded 'C:\WINNT\system32\ole32.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\system32\uxtheme.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\system32\MSCTF.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\system32\SKHOOKS.DLL', Binary was not built with debug information.
'MechEditor.exe': Loaded 'C:\Program Files\Unlocker\UnlockerHook.dll', Binary was not built with debug information.
'MechEditor.exe': Loaded 'C:\WINNT\system32\rsaenh.dll', No symbols loaded.
'MechEditor.exe' (Managed): Loaded 'D:\My Documents\My Programms\Personal Progs\NET 1-2.0\Mech Studio .NET 2\Mech Editor\bin\Debug\MechEditor.exe', Symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\Microsoft.NET\Framework\v2.0.50727\mscorjit.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\assembly\NativeImages_v2.0.50727_32\System\a3c69631adf91b43963a04ee1c63a8c6\System.ni.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\assembly\NativeImages_v2.0.50727_32\System.Drawing\5d673fc1d3866544a0d0536352e6d5f8\System.Drawing.ni.dll', No symbols loaded.
'MechEditor.exe': Loaded 'C:\WINNT\assembly\NativeImages_v2.0.50727_32\System.Windows.Forms\c45495c9d805234da5a8a3fff7913d6d\System.Windows.Forms.ni.dll', No symbols loaded.
'MechEditor.exe' (Managed): Loaded 'C:\WINNT\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.
'MechEditor.exe' (Managed): Loaded 'C:\WINNT\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.
'MechEditor.exe' (Managed): Loaded 'C:\WINNT\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.
'MechEditor.exe': Loaded 'C:\WINNT\system32\xpsp2res.dll', Binary was not built with debug information.
'MechEditor.exe' (Managed): Loaded 'D:\My Documents\My Programms\Personal Progs\NET 1-2.0\Mech Studio .NET 2\Mech Editor\bin\Debug\Viewport.dll', Symbols loaded.
'MechEditor.exe': Loaded 'D:\My Documents\My Programms\Personal Progs\NET 1-2.0\Mech Studio .NET 2\Mech Editor\bin\Debug\MechModel.dll', No symbols loaded.
'MechEditor.exe': Unloaded 'D:\My Documents\My Programms\Personal Progs\NET 1-2.0\Mech Studio .NET 2\Mech Editor\bin\Debug\MechModel.dll'
First-chance exception at 0x7c812a5b in MechEditor.exe: Microsoft C++ exception: HRException at memory location 0x0012e0d0..
First-chance exception at 0x7c812a5b in MechEditor.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
A first chance exception of type 'System.IO.FileNotFoundException' occurred in MechEditor.exe
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in MechEditor.exe

Additional information: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

'MechEditor.exe': Loaded 'C:\WINNT\assembly\NativeImages_v2.0.50727_32\System.Configuration\c6c30caade587442887b045ede82deea\System.Configuration.ni.dll', No symbols loaded.
'MechEditor.exe' (Managed): Loaded 'C:\WINNT\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'MechEditor.exe': Loaded 'C:\WINNT\assembly\NativeImages_v2.0.50727_32\System.Xml\909576cfe0471d4d930f09068c4af000\System.Xml.ni.dll', No symbols loaded.
'MechEditor.exe' (Managed): Loaded 'C:\WINNT\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.
The program '[3572] MechEditor.exe: Managed' has exited with code 0 (0x0).
The program '[3572] MechEditor.exe: Native' has exited with code 0 (0x0).


Please, help me to find root cause of the problem, because simple reinstallation of .NET Runtime doesn't help.


Re: Visual C++ General .NET 2.0 Application fails to load Mixed Mode C++/CLI assembly in particular PC environment (HRESULT: 0x80070002)

Anonymous

Try to use dll compiled on a machine without the problem in order to investigate it.

Did you find a solution





Re: Visual C++ General .NET 2.0 Application fails to load Mixed Mode C++/CLI assembly in particular PC environment (HRESULT: 0x80070002)

GoldRunner

I was trying to compile my application on the machine, were it works fine and than run this binaries on the problem machine. The result is: the same code works on one machine and do not work on other problem machines. This shows that VS 2005 builds the same code on all machines, but it runs on some of them and do not run (with specified errors) on other machines.




Re: Visual C++ General .NET 2.0 Application fails to load Mixed Mode C++/CLI assembly in particular PC environment (HRESULT: 0x80070002)

Anonymous

I just solve the problem by installing again Vista sdk with c++ compiler



Re: Visual C++ General .NET 2.0 Application fails to load Mixed Mode C++/CLI assembly in particular PC environment (HRESULT: 0x80070002)

Anonymous

I just solve the problem by install Vista sdk with c++ compiler



Re: Visual C++ General .NET 2.0 Application fails to load Mixed Mode C++/CLI assembly in particular PC environment (HRESULT: 0x80070002)

GoldRunner

Actualy I have this problem on some XP computers, but on Vista it is reproduced stable. Could you please provide a link to the download page of this SDK




Re: Visual C++ General .NET 2.0 Application fails to load Mixed Mode C++/CLI assembly in particular PC environment (HRESULT: 0x80070002)

GoldRunner

I have Windows SDK 6.0 installed under Vista, but still have this problem. Could you specify some details about the compiler and SDK, you installed I need to know the download link of this SDK and full compiler name and version.




Re: Visual C++ General .NET 2.0 Application fails to load Mixed Mode C++/CLI assembly in particular PC environment (HRESULT: 0x80070002)

GoldRunner

I've fixed the problem. I used FileMon utility (From Sysinternals: http://www.microsoft.com/technet/sysinternals/FileAndDisk/Filemon.mspx) to log all requests to the file system, performed by my application and find Error requests, that cause my error. This investigation has shown that application was searching for MSVCM80D.DLL, and didn't found it. I copied this and related with it libraries (from directory D:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_5490cd9f) from the machine were it works to the problem PC. This fixed the problem. May be reinstallation of MS C++ Compiler also copies this DLL and could help too. This scenrio works on WinXP, but on Windows Vista this library should be located by different path.




Re: Visual C++ General .NET 2.0 Application fails to load Mixed Mode C++/CLI assembly in particular PC environment (HRESULT: 0x80070002)

Wojo

You don't have to copy the dll's locally, you could just embed the manifest into the exe\dll that the loader will probe and load the appropriate version of the debug crt dll.

You can set this under Project Properties --> Configuration Properties --> linker --> Additonal Manifest Dependencies

or do it direct in the source file like below (mine was for MFC dll's)

#pragma message ("Explicit link to generate a manifest entry for MFC.")

#if defined (_DEBUG)

#pragma comment(linker, "\"/manifestdependency:type='win32' name='Microsoft.VC80.DebugMFC' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'\"")

#else

#pragma comment(linker, "\"/manifestdependency:type='win32' name='Microsoft.VC80.MFC' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'\"")

#endif





Re: Visual C++ General .NET 2.0 Application fails to load Mixed Mode C++/CLI assembly in particular PC environment (HRESULT: 0x80070002)

Anonymous

Please look at

http://msdn2.microsoft.com/en-us/vstudio/aa718685.aspx

Section 1.1