The managed c++ dll is linked with /MACHINE:X86, and it works fine on a 32
bit machine, and it works fine with a 32 bit c++ app.
I don't know if this will help. But here is the output of the loads.
Tester.exe is the c++ app, testcSharp is the c sharp app. They are both
trying to load the same crutilNet.dll
'tester.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.
'tester.exe' (Managed): Loaded 'c:\projects\crutilNet\debug\tester.exe',
Symbols loaded.
'tester.exe' (Managed): Loaded 'c:\projects\crutilNet\debug\msvcm80d.dll',
No symbols loaded.
'tester.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.
'tester.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.
'tester.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.
'tester.exe' (Managed): Loaded 'c:\projects\crutilNet\debug\crutilNet.dll',
Symbols loaded.
'tester.exe' (Managed): Loaded
'C:\Windows\WinSxS\x86_microsoft.vc80.debugcrt_1fc8b3b9a1e18e3b_8.0.50727.762_none_24c8a196583ff03b\msvcm80d.dll', Symbols loaded.
'testcSharp.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.
'testcSharp.vshost.exe' (Managed): Loaded
'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'testcSharp.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.
'testcSharp.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.
'testcSharp.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.
'testcSharp.vshost.exe' (Managed): Loaded
'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\8.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.
'testcSharp.vshost.exe' (Managed): Loaded
'C:\projects\crutilNet\testcSharp\bin\Debug\testcSharp.vshost.exe', Skipped
loading symbols. Module is optimized and the debugger option 'Just My Code'
is enabled.
'testcSharp.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.
'testcSharp.vshost.exe' (Managed): Loaded
'C:\Windows\assembly\GAC_MSIL\System.Deployment\2.0.0.0__b03f5f7f11d50a3a\System.Deployment.dll',
Skipped loading symbols. Module is optimized and the debugger option 'Just My
Code' is enabled.
'testcSharp.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.
The thread 0x1188 has exited with code 0 (0x0).
The thread 0x158 has exited with code 0 (0x0).
The thread 0xa4 has exited with code 0 (0x0).
'testcSharp.vshost.exe' (Managed): Loaded
'C:\projects\crutilNet\testcSharp\bin\Debug\testcSharp.exe', Symbols loaded.
'testcSharp.vshost.exe' (Managed): Loaded
'C:\Windows\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.
A first chance exception of type 'System.TypeInitializationException'
occurred in testcSharp.exe
[quoted text, click to view] "Willy Denoyette [MVP]" wrote:
> "SGRing" <SGRing@discussions.microsoft.com> wrote in message
> news:920B7A30-CC32-4DCA-936F-AE8EA9EE1BAC@microsoft.com...
> > As far as I can tell, everything should be 32 bit. I set the properties of
> > the c# project to be x86 and it shows the 32 bit .net get loaded. But, I
> > still get the error.
> >
> >
>
> How about the managed C++ DLL, is it compiled as 32 bit (see linker option
> /machine)?
> There must be some component with incompatible bitness in the game.
>
> Willy.
>
>
>
>
I've taken my 32 my installer, which installs a working project on all 32 bit
machines, and installed it on clean 64 bit machines (xp & vista). These are
machines that only have the os, and my application. In both cases I get
invalid format errors from my two dll's that are managed c++ dll's. Also in
both cases, I can load these dll's without error using a managed c++ main
program in place of my c# main program.
I have run fuslogvw (output below), but I don't see anything useful there.
*** Assembly Binder Log Entry (8/27/2007 @ 4:26:04 PM) ***
The operation failed.
Bind result: hr = 0x8007000b. An attempt was made to load a program with an
incorrect format.
Assembly manager loaded from:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll
Running under executable C:\Program Files (x86)\CRTech\Sinaps\Sinaps2.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = VMXP64\steve
LOG: DisplayName = crutilNet, Version=1.0.2734.19007, Culture=neutral,
PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/CRTech/Sinaps/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : Sinaps2Dll, Version=1.0.2791.27028, Culture=neutral,
PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Program Files
(x86)/CRTech/Sinaps/crutilNet.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Program
Files (x86)\CRTech\Sinaps\crutilNet.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: crutilNet, Version=1.0.2734.19007, Culture=neutral,
PublicKeyToken=null
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing
terminated.
[quoted text, click to view] "Willy Denoyette [MVP]" wrote:
> "SGRing" <SGRing@discussions.microsoft.com> wrote in message
> news:BA54B6B9-B1CE-46E1-9F2C-28C8B914F270@microsoft.com...
> > The managed c++ dll is linked with /MACHINE:X86, and it works fine on a 32
> > bit machine, and it works fine with a 32 bit c++ app.
> >
>
> Is there a 64bit version of this module installed on this machine? If there
> is none, then I don't see where the incorrect assembly comes from!
>
> > I don't know if this will help. But here is the output of the loads.
> > Tester.exe is the c++ app, testcSharp is the c sharp app. They are both
> > trying to load the same crutilNet.dll
> >
> > 'tester.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.
> > 'tester.exe' (Managed): Loaded 'c:\projects\crutilNet\debug\tester.exe',
> > Symbols loaded.
> > 'tester.exe' (Managed): Loaded 'c:\projects\crutilNet\debug\msvcm80d.dll',
> > No symbols loaded.
> > 'tester.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.
> > 'tester.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.
> > 'tester.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.
> > 'tester.exe' (Managed): Loaded
> > 'c:\projects\crutilNet\debug\crutilNet.dll',
> > Symbols loaded.
> > 'tester.exe' (Managed): Loaded
> > 'C:\Windows\WinSxS\x86_microsoft.vc80.debugcrt_1fc8b3b9a1e18e3b_8.0.50727.762_none_24c8a196583ff03b\msvcm80d.dll',
> > Symbols loaded.
> >
> >
> >
> > 'testcSharp.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.
> > 'testcSharp.vshost.exe' (Managed): Loaded
> > 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll',
> > Skipped loading symbols. Module is optimized and the debugger option 'Just
> > My
> > Code' is enabled.
> > 'testcSharp.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.
> > 'testcSharp.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.
> > 'testcSharp.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.
> > 'testcSharp.vshost.exe' (Managed): Loaded
> > 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\8.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.
> > 'testcSharp.vshost.exe' (Managed): Loaded
> > 'C:\projects\crutilNet\testcSharp\bin\Debug\testcSharp.vshost.exe',
> > Skipped
> > loading symbols. Module is optimized and the debugger option 'Just My
> > Code'
> > is enabled.
> > 'testcSharp.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.
> > 'testcSharp.vshost.exe' (Managed): Loaded
> > 'C:\Windows\assembly\GAC_MSIL\System.Deployment\2.0.0.0__b03f5f7f11d50a3a\System.Deployment.dll',
> > Skipped loading symbols. Module is optimized and the debugger option 'Just
> > My
> > Code' is enabled.
> > 'testcSharp.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.
> > The thread 0x1188 has exited with code 0 (0x0).
Here's the same result from the c++ program. The difference is that the c++
main program load Framework, and the c# main program loads Framework64. So,
how can I get the c# program to just use Framework?
*** Assembly Binder Log Entry (8/28/2007 @ 2:27:37 PM) ***
The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.
Assembly manager loaded from:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable C:\Program Files (x86)\CRTech\Sinaps\tester.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = VMXP64\steve
LOG: DisplayName = crutilNet, Version=1.0.2795.13312, Culture=neutral,
PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/CRTech/Sinaps/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : tester, Version=1.0.2795.13314, Culture=neutral,
PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Program Files
(x86)/CRTech/Sinaps/crutilNet.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Program
Files (x86)\CRTech\Sinaps\crutilNet.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: crutilNet, Version=1.0.2734.19007, Culture=neutral,
PublicKeyToken=null
LOG: Binding succeeds. Returns assembly from C:\Program Files
(x86)\CRTech\Sinaps\crutilNet.dll.
LOG: Assembly is loaded in default load context.
[quoted text, click to view] "SGRing" wrote:
> I've taken my 32 my installer, which installs a working project on all 32 bit
> machines, and installed it on clean 64 bit machines (xp & vista). These are
> machines that only have the os, and my application. In both cases I get
> invalid format errors from my two dll's that are managed c++ dll's. Also in
> both cases, I can load these dll's without error using a managed c++ main
> program in place of my c# main program.
>
> I have run fuslogvw (output below), but I don't see anything useful there.
>
> *** Assembly Binder Log Entry (8/27/2007 @ 4:26:04 PM) ***
>
> The operation failed.
> Bind result: hr = 0x8007000b. An attempt was made to load a program with an
> incorrect format.
>
> Assembly manager loaded from:
> C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll
> Running under executable C:\Program Files (x86)\CRTech\Sinaps\Sinaps2.exe
> --- A detailed error log follows.
>
> === Pre-bind state information ===
> LOG: User = VMXP64\steve
> LOG: DisplayName = crutilNet, Version=1.0.2734.19007, Culture=neutral,
> PublicKeyToken=null
> (Fully-specified)
> LOG: Appbase = file:///C:/Program Files (x86)/CRTech/Sinaps/
> LOG: Initial PrivatePath = NULL
> LOG: Dynamic Base = NULL
> LOG: Cache Base = NULL
> LOG: AppName = NULL
> Calling assembly : Sinaps2Dll, Version=1.0.2791.27028, Culture=neutral,
> PublicKeyToken=null.
> ===
> LOG: This bind starts in default load context.
> LOG: No application configuration file found.
> LOG: Using machine configuration file from
> C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
> LOG: Policy not being applied to reference at this time (private, custom,
> partial, or location-based assembly bind).
> LOG: Attempting download of new URL file:///C:/Program Files
> (x86)/CRTech/Sinaps/crutilNet.DLL.
> LOG: Assembly download was successful. Attempting setup of file: C:\Program
> Files (x86)\CRTech\Sinaps\crutilNet.dll
> LOG: Entering run-from-source setup phase.
> LOG: Assembly Name is: crutilNet, Version=1.0.2734.19007, Culture=neutral,
> PublicKeyToken=null
> ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing
> terminated.
>
>
> "Willy Denoyette [MVP]" wrote:
>
> > "SGRing" <SGRing@discussions.microsoft.com> wrote in message
> > news:BA54B6B9-B1CE-46E1-9F2C-28C8B914F270@microsoft.com...
> > > The managed c++ dll is linked with /MACHINE:X86, and it works fine on a 32
> > > bit machine, and it works fine with a 32 bit c++ app.
> > >
> >
> > Is there a 64bit version of this module installed on this machine? If there
> > is none, then I don't see where the incorrect assembly comes from!
> >
> > > I don't know if this will help. But here is the output of the loads.
> > > Tester.exe is the c++ app, testcSharp is the c sharp app. They are both
> > > trying to load the same crutilNet.dll
> > >
> > > 'tester.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.
> > > 'tester.exe' (Managed): Loaded 'c:\projects\crutilNet\debug\tester.exe',
> > > Symbols loaded.
> > > 'tester.exe' (Managed): Loaded 'c:\projects\crutilNet\debug\msvcm80d.dll',
> > > No symbols loaded.
> > > 'tester.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.
> > > 'tester.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.
> > > 'tester.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.
> > > 'tester.exe' (Managed): Loaded
> > > 'c:\projects\crutilNet\debug\crutilNet.dll',
> > > Symbols loaded.
> > > 'tester.exe' (Managed): Loaded
> > > 'C:\Windows\WinSxS\x86_microsoft.vc80.debugcrt_1fc8b3b9a1e18e3b_8.0.50727.762_none_24c8a196583ff03b\msvcm80d.dll',
> > > Symbols loaded.
> > >
> > >
> > >
> > > 'testcSharp.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.
> > > 'testcSharp.vshost.exe' (Managed): Loaded
> > > 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll',
> > > Skipped loading symbols. Module is optimized and the debugger option 'Just
> > > My
> > > Code' is enabled.
> > > 'testcSharp.vshost.exe' (Managed): Loaded
Thanks, that fixed it.
[quoted text, click to view] "Willy Denoyette [MVP]" wrote:
> "SGRing" <SGRing@discussions.microsoft.com> wrote in message
> news:0AED67FB-1ABA-4F1B-8105-91D8134E0567@microsoft.com...
> > Here's the same result from the c++ program. The difference is that the
> > c++
> > main program load Framework, and the c# main program loads Framework64.
> > So,
> > how can I get the c# program to just use Framework?
> >
>
>
> If the C# main program loads the 64 bit framework it's because it's build
> using the default platform flag value (MSIL). You need to build your C#
> program with "platform = X86" in order to load the 32 bit framework.
>
> Willy.
>
[quoted text, click to view] "SGRing" <SGRing@discussions.microsoft.com> wrote in message
news:0AED67FB-1ABA-4F1B-8105-91D8134E0567@microsoft.com...
> Here's the same result from the c++ program. The difference is that the
> c++
> main program load Framework, and the c# main program loads Framework64.
> So,
> how can I get the c# program to just use Framework?
>
If the C# main program loads the 64 bit framework it's because it's build
using the default platform flag value (MSIL). You need to build your C#
program with "platform = X86" in order to load the 32 bit framework.
Willy.
Don't see what you're looking for? Try a search.