在Windows 7 64位计算机上开发的VB.Net应用程序,但它无法在Windows XP 32位计算机上运行。 [英] A VB.Net application developed in Windows 7 64 bit machine but it can not run in Windows XP 32 bit machine.

查看:141
本文介绍了在Windows 7 64位计算机上开发的VB.Net应用程序,但它无法在Windows XP 32位计算机上运行。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Windows 7 OS 64位机器上开发VB.Net平台的Windows XP操作系统中运行应用程序?

解决方案

要检查的第一件事是:目标机器是否具有与您编写应用程序的框架相同的版本?



要检查的第二件事是:是否有任何其他DDL被引用未在目标机器上注册的开发机器?



如果可以提供更多详细信息,我可以给出更好的答案。


< blockquote>如果某个程序集针对两个64位指令集架构之一,则无法在32位系统中运行。同时,32位应用程序可以通过WoW64在任何64位Windows版本上运行:

http://en.wikipedia.org/wiki/WOW64 [ ^ ]。



你应该总是喜欢目标AnyCPU。应用程序使用的所有程序集都是这样的,您的应用程序将适用于任何体系结构。实际代码将由JIT编译器生成,具体取决于运行时的实际平台。如果只将入口点程序集(通常是EXE)编译为某个指令集目标,它实际上将定义整个应用程序使用的指令集。



没有办法在一个进程中混合编译到不同指令集体系结构的程序集(或任何可执行模块,包括任何可由任何程序集使用的任何可执行模块)。无论您在运行时尝试使用哪种平台,此类应用程序都无法运行。



这些非托管可执行模块(PE文件)对多目标软件提出了一个特殊问题。它们通常被编译为某个指令集目标体系结构,因此它决定了使用它们的程序集的目标,并且这些程序集规定了整个应用程序的指令集体系结构。如果要使项目在不同的指令集目标体系结构上工作,则应该提供一种方法来将这些模块替换为编译到不同目标的版本。这是通常的情况,当安装包(如MSI)检测到实际平台并为对指令集架构敏感的模块提供适当的版本时:非托管模块和组件直接依赖于它们(例如使用P / Invoke的组件或编译为混合模式C ++ / CLI项目的程序集。



请参阅:

http://en.wikipedia.org/wiki/Instruction_set [ ^ ],

http: //en.wikipedia.org/wiki/Just-in-time_compilation [ ^ ],

http://en.wikipedia.org/ wiki / Platform_Invocation_Services [ ^ ],

http://en.wikipedia.org/wiki/Managed_code [ ^ ],

http:// en .wikipedia.org / wiki / C%2B%2B / CLI [ ^ ],

http:/ /msdn.microsoft.com/en-us/library/xey702bw.aspx [ ^ ],

http://www.ecma-international.org/publications/standards/Ecma-372.htm [ ^ ]。



-SA


How can I run a application in Windows XP operating system which developed VB.Net platform on Windows 7 OS 64 bit machine?

解决方案

The first thing to check is: Does the target machine have the same version of the Framework that you wrote the application in?

The second thing to check is: Are there any additional DDLs referenced on the development machine that are not registered on the target machine?

I could give a better answer if you could provide more details.


If some assembly is targeted to one of the two 64-bit instruction-set architecture there is no a way for it to run in a 32-bit system. At the same time, a 32-bit application will work on any 64-bit Windows version via WoW64:
http://en.wikipedia.org/wiki/WOW64[^].

You should always prefer the target "AnyCPU". Is all the assemblies used by your applications are like that, your application will work on any of the architecture. Actual code will be generated by the JIT compiler, depending on the actual platform during run-time. If only the entry-point assembly (usually, EXE) is compiled to a certain instruction-set target, it will actually define the instruction set used by the whole application.

There is no a way to mix assemblies (or any executable modules, including unmanaged ones, use by any of the assemblies) compiled to different instruction-set architectures in one process. Such application cannot work, no matter what platform you would try to use during runtime.

Those unmanaged executable modules (PE files) presents a special problem for multi-targeted software. They are usually compiled to once certain instruction-set target architecture, so it dictates the target of the assemblies using them, and those assemblies dictate the instruction-set architecture of the whole application. If you want to make a project working on different instruction-set target architectures, you should provide a way to replace those modules with the versions compiled to different target. This is the usual situation, when the installation package (like MSI) detects the actual platform and provided appropriate versions for the modules sensitive to the instruction-set architecture: unmanaged modules and assemblies directly depending on them (such as assemblies using P/Invoke or assemblies compiled as mixed-mode C++/CLI projects).

Please see also:
http://en.wikipedia.org/wiki/Instruction_set[^],
http://en.wikipedia.org/wiki/Just-in-time_compilation[^],
http://en.wikipedia.org/wiki/Platform_Invocation_Services[^],
http://en.wikipedia.org/wiki/Managed_code[^],
http://en.wikipedia.org/wiki/C%2B%2B/CLI[^],
http://msdn.microsoft.com/en-us/library/xey702bw.aspx[^],
http://www.ecma-international.org/publications/standards/Ecma-372.htm[^].

—SA


这篇关于在Windows 7 64位计算机上开发的VB.Net应用程序,但它无法在Windows XP 32位计算机上运行。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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