不是有效的Win32应用程序 [英] Not a valid Win32 application

查看:98
本文介绍了不是有效的Win32应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在Windows 7计算机上的Visual Studio 2010中构建的项目.它可以编译并运行而不会出现问题.

I have a project I have built in Visual Studio 2010 on a Windows 7 machine. It compiles and runs without a problem.

当我将应用程序放置在具有.NET 4的XP计算机上时,它不会运行并显示错误不是有效的Win32应用程序"

When I place the application on a XP machine with .NET 4 it does not run with the error "is not a valid Win32 application"

我在这里尝试了一切都没有运气: http://blogs.msdn.com/b/dsvc/archive/2009/06/19/troubleshooting-not-a-valid-win32-application-error-at-the-startup.aspx

I tried everything here with no luck: http://blogs.msdn.com/b/dsvc/archive/2009/06/19/troubleshooting-not-a-valid-win32-application-error-at-the-startup.aspx

我不知道怎么了.有什么想法吗?

I have no idea what is wrong. Any ideas?

谢谢

仅供参考:bindump:

FYI: bindump:

 Microsoft (R) COFF/PE Dumper Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file TimeKeeper.exe

PE signature found

File Type: EXECUTABLE IMAGE

FILE HEADER VALUES
            8664 machine (x64)
               2 number of sections
        4D24EED9 time date stamp Thu Jan 06 09:21:13 2011
               0 file pointer to symbol table
               0 number of symbols
              F0 size of optional header
              22 characteristics
                   Executable
                   Application can handle large (>2GB) addresses

OPTIONAL HEADER VALUES
             20B magic # (PE32+)
            8.00 linker version
           92600 size of code
             600 size of initialized data
               0 size of uninitialized data
               0 entry point
            2000 base of code
          400000 image base (0000000000400000 to 0000000000497FFF)
            2000 section alignment
             200 file alignment
            4.00 operating system version
            0.00 image version
            4.00 subsystem version
               0 Win32 version
           98000 size of image
             200 size of headers
               0 checksum
               2 subsystem (Windows GUI)
            8540 DLL characteristics
                   Dynamic base
                   NX compatible
                   No structured exception handler
                   Terminal Server Aware
          400000 size of stack reserve
            4000 size of stack commit
          100000 size of heap reserve
            2000 size of heap commit
               0 loader flags
              10 number of directories
               0 [       0] RVA [size] of Export Directory
               0 [       0] RVA [size] of Import Directory
           96000 [     598] RVA [size] of Resource Directory
               0 [       0] RVA [size] of Exception Directory
               0 [       0] RVA [size] of Certificates Directory
               0 [       0] RVA [size] of Base Relocation Directory
           94454 [      1C] RVA [size] of Debug Directory
               0 [       0] RVA [size] of Architecture Directory
               0 [       0] RVA [size] of Global Pointer Directory
               0 [       0] RVA [size] of Thread Storage Directory
               0 [       0] RVA [size] of Load Configuration Directory
               0 [       0] RVA [size] of Bound Import Directory
               0 [       0] RVA [size] of Import Address Table Directory
               0 [       0] RVA [size] of Delay Import Directory
            2000 [      48] RVA [size] of COM Descriptor Directory
               0 [       0] RVA [size] of Reserved Directory


SECTION HEADER #1
   .text name
   924FE virtual size
    2000 virtual address (0000000000402000 to 00000000004944FD)
   92600 size of raw data
     200 file pointer to raw data (00000200 to 000927FF)
       0 file pointer to relocation table
       0 file pointer to line numbers
       0 number of relocations
       0 number of line numbers
60000020 flags
         Code
         Execute Read

  Debug Directories

        Time Type       Size      RVA  Pointer
    -------- ------ -------- -------- --------
    4D24EED9 cv           8E 00094470    92670    Format: RSDS, {07D03CC8-7510-4698-B5EB-6DC50714B88D}, 3, C:\Users\Mitch\Documents\Timekeeper 24.12.2010\client\TimeKeeper 24-12-2010\TimeKeeper\obj\x86\Release\TimeKeeper.pdb

SECTION HEADER #2
   .rsrc name
     598 virtual size
   96000 virtual address (0000000000496000 to 0000000000496597)
     600 size of raw data
   92800 file pointer to raw data (00092800 to 00092DFF)
       0 file pointer to relocation table
       0 file pointer to line numbers
       0 number of relocations
       0 number of line numbers
40000040 flags
         Initialized Data
         Read Only

  Summary

        2000 .rsrc
       94000 .text

推荐答案

在项目属性中,该项目的目标是"x64"而不是任何CPU"吗? (似乎在bindump标头中说的是"machine(x64)",这听起来可能是问题所在)

In the project properties, is the project targeting "x64" rather than "Any CPU"? (It does seem to say "machine (x64)" in the bindump header, which sounds like this may be the issue)

它是定位到.net 4完整版还是客户端配置文件?如果已满,请检查您的XP是否已安装完整的配置文件,而不仅仅是客户端配置文件.

Is it targetting .net 4 full or client profile? If full, check that your XP has the full profile installed, not just the client profile.

(不太可能相关,但是)XP机器上是否安装了Visual Studio 2010 redist?

(Unlikely to be related, but) Is the Visual Studio 2010 redist installed on the XP machine?

检查文件在传输到Win32计算机上的过程中是否没有损坏(例如,将文件复制回并进行比较或在Win7机器上运行)

Check that the file hasn't been corrupted during the transfer onto the Win32 machine (e.g. copy it back and diff it or run it on your Win7 box)

这篇关于不是有效的Win32应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆