32-bit CLR application on 64-bit system

Discussion in 'Windows 64bit' started by Martin Plechsmid, Oct 15, 2009.

  1. Hello.

    I'm trying to get working Debug version of our 32-bit CLR dll on a 64-bit
    Server 2003, so far unsucessfully. I reduced the problem to not get working
    *any* Debug 32-bit CLR application on a 64-bit system.

    In VS2008 I created a new "CLR Console Application" project, and compiled it
    *without* modifications. The 32-bit binary prints "Hello World" on a
    32-system. But when I copy that binary to a 64-bit system, its Debug version
    cannot be executed. The system replies with error "The system cannot execute
    the specified program.". I have no idea where lies the problem. Can anyone
    help me?

    Details:
    - Release version of the same HelloWorld application works fine.
    - The problem hasn't disappear when I took a *clean* installation of Windows
    Server 2003 R2 SP2 Standard x64 Edition. I installed .NET 2.0 SP1 (x64
    version) and VC9 redistributable packages (x86 version; this installed the
    release version, the debug version of CRT was copied from VS2008). *Nothing*
    else was installed. Then again, the release version worked fine, the debug
    version didn't execute.
    - The HelloWorld application was compiled on a 32-bit VS2008 for (the
    default) Win32 platform and .NET 2.0, and the linker target was for x86.
    - On the x64 machine, the exact system response when executing the
    release/debug versions is:

    E:\temp>test.exe
    Hello World

    E:\temp>testd.exe
    The system cannot execute the specified program.

    - For the Debug version of the HelloWorld application, Dependency Walker
    reports (apart to seemingly harmless errors) the following critical(?)
    error:

    Error: The Side-by-Side configuration information for
    "E:\temp\testd.exe" contains errors. This application has failed to start
    because the application configuration is incorrect.

    The strange thing is that Dependency Walker shows no difference in
    dependencies between release and debug versions (apart of dependency on the
    release/debug versions of MSVC*.DLLs). And the Release version reports no
    such error. See the attached image.
    - I think that the other errors reported by Dependency Walker are harmless
    because they are reported even for the working Release version of the
    aplication:

    Error: At least one module has an unresolved import due to a missing
    export function in an implicitly dependent module.
    Error: Modules with different CPU types were found.

    - The manifest embedded in the Debug version of the test application is:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1"
    manifestVersion="1.0">
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
    <requestedPrivileges>
    <requestedExecutionLevel level="asInvoker"
    uiAccess="false"></requestedExecutionLevel>
    </requestedPrivileges>
    </security>
    </trustInfo>
    <dependency>
    <dependentAssembly>
    <assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT"
    version="9.0.21022.8" processorArchitecture="x86"
    publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
    </dependency>
    </assembly>

    For Release version it refers CRT instead of DebugCRT, the rest of the
    manifest is identical.
    - I'm aware that the debug versions of CRT libraries are not installed
    automatically on x64 systems. That's why I copied them from VS2008 into the
    application directory.
    - Further information - if necessary - was discussed in the thread of the
    same name in the microsoft.public.dotnet.framework.clr news-group. The
    discussion there is probably ceased.

    Thank you,

    Martin.
     
    Martin Plechsmid, Oct 15, 2009
    #1
    1. Advertising

  2. Martin Plechsmid

    Doug Forster Guest

    Hello Martin,

    Probably not much help but I develop with VS2008 on a Win7 x64 system so
    I just made a default debug 32 bit CLR Hello World console app and it
    worked just fine. However I don't use CLR at all so I don't know what
    your problem is but surely it must be a missing dependency? Can you try
    remote debugging your X64 box or does it not start at all?

    This is probably not a good NG for dev questions, the folks here are
    mostly system setup experts rather than developers.

    Cheers
    Doug Forster
     
    Doug Forster, Oct 16, 2009
    #2
    1. Advertising

  3. Martin Plechsmid, Oct 16, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eva
    Replies:
    2
    Views:
    329
    Tony Sperling
    Sep 6, 2005
  2. steadar
    Replies:
    2
    Views:
    639
    Charlie Russel - MVP
    Sep 29, 2006
  3. jm139
    Replies:
    1
    Views:
    7,347
    Charlie Russel - MVP
    Jul 2, 2007
  4. doom

    NET CLR Networking?

    doom, Nov 20, 2007, in forum: Windows 64bit
    Replies:
    2
    Views:
    783
  5. BP
    Replies:
    2
    Views:
    1,127
    PhilSweet
    Dec 19, 2008
Loading...

Share This Page