任何CPU平台和X86平台 [英] Any CPU platform and X86 Platform

查看:76
本文介绍了任何CPU平台和X86平台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我真的对目标平台感到困惑.为了获得最佳结果,要使我的应用程序在任何CPU上运行,应使用哪种目标平台.我尝试使用任何CPU,但我的应用程序无法在安装了Access 2010的Windows 7上运行.返回错误

Hi,
I am really confused about target platform. For best results, to make my application run on any CPU, what target platform should be used. I tried Any CPU but my application does not run on Windows 7 with Access 2010 installed. It returns an error

The ''Microsoft.Jet.OLEDB.4.0'' provider is not registered on the local machine


有人告诉我为避免此错误,请将平台更改为X86.但是我也无法改变.下拉菜单仅包含任何CPU.

该怎么办?
感谢


Someone told me to avoid this error, change platform to X86. But I am unable to change that too. Dropdown menu contains only Any CPU.

What to do?
Thanks

推荐答案

阅读以下内容: http://visualstudiohacks.com/articles/visual-studio-net-platform-target-explained/ [
Read the following : http://visualstudiohacks.com/articles/visual-studio-net-platform-target-explained/[^]


此问题与目标平台没有直接关系.尚未安装必需的组件.

现在,简而言之,关于使用目标平台:

您永远不能在一个过程中混合使用两种不同的指令集体系结构.解决方案可能会生成,但应用程序可能会在运行时崩溃.根据经验,除非某些第三方和/或非托管组件要求任何特定目标,否则应始终使用任何CPU".由于程序集是通过JIT编译的,因此任何CPU"都是可能的,因此,在加载应用程序时,可以即时定义真正的非托管目标.

它是如何定义的?当使用任何CPU"编译应用程序的所有汇编时,运行时目标都由当​​前正在运行的OS定义.如果所有对象库都使用任何CPU"进行编译,但入口程序集(具有入口点(默认为Main并定义要运行的应用程序的程序集,通常为* .EXE文件))将针对某些对象进行编译.某些指令集体系结构,入口程序集将定义最终的目标体系结构.

如果该过程加载的任何两个程序集(无论如何,包括引用和动态加载的程序集)定义了两种不同的指令集体系结构,请在运行时接受崩溃.



Windows 64位平台还通过WoW64(
http://en.wikipedia.org/wiki/WOW64 [^ ].
这实际上是一个用于运行32位应用程序的64位子系统.

即使64位指令集平台彼此不兼容(x86-64与IA-64"Itanium"),它们在基于WoW64的32位级别上也是兼容的.参见:
http://en.wikipedia.org/wiki/X86-64 [ http://en.wikipedia.org/wiki/Itanium [
—SA
This problem is not directly related to target platform. Required component is not installed, that''s it.

Now, about using the target platform, in a nutshell:

You can never mix up two different instruction-set architectures in one process. The solution might build but the application may crash during run-time. As a rule of thumb, you should always use "Any CPU" unless some third-party and/or unmanaged components requires any certain target. "Any CPU" is possible as assemblies are JIT-compiled, so the real unmanaged target is defined on the fly when an application is loaded.

How is it defined? When all the assembles of an application are compiled with "Any CPU", the run-time target is defined by that of currently running OS. If all the object libraries are compiled with "Any CPU" but the entry assembly (the one which has an entry point (Main by default) and defines which application to run, normally some *.EXE file) is compiled to target some certain instruction-set architecture, the entry assembly will define the resulting target architecture.

If any two assemblies loaded by the process (no matter how, including references and dynamically loaded assemblies) define two different instruction-set architectures, accept a crash during run time.



Windows 64-bit platforms also support a 32-bit platform through WoW64, http://en.wikipedia.org/wiki/WOW64[^].
This is actually a 64-bit subsystem used to run 32-bit applications.

Even though 64-bit instruction-set platforms are not compatible with each other (x86-64 vs. IA-64 "Itanium"), they are compatible at the level of 32-bit based on WoW64. See:
http://en.wikipedia.org/wiki/X86-64[^],
http://en.wikipedia.org/wiki/Itanium[^].

Sometimes a .NET application has to be run as 32-bit over WoW64, as not all of 64-bit (usually unmanages) components are available. An attempt to run this application compiled to "Any CPU" will result to running it as a 64-bit application. One way to run it over WoW64 is to recompile just the entry assembly to the instruction-set platform "x86".

—SA


我不明白您的问题您是说这是平台问题,但是您的错误说驱动程序建立连接所必需的
没有在系统上正确注册.
您在问题中提到
I didn''t understand your question You are saying that it is Platform Problem but your error says that the driver required for establishing connection
are not properly registered on your System.
As you mentioned in your question
"Microsoft.Jet.Oledb.4.0"


是在ConnectionString中用于将Access数据库与Application连接的Provider.您正在使用MS-Access 2010,而您正在使用的Provider
ConetionString中提到的内容,即"Microsoft.Jet.Oledb.4.0"用于
与Access 2003连接.因此,请查找Ms-Access 2010的提供程序.希望它能解决您的问题.


is the Provider which is used in ConnectionString to Connect the Access DataBase with Application.You are using MS-Access 2010 and the Provider you
mentioned into the ConetionString i.e "Microsoft.Jet.Oledb.4.0" is used to
Connect with Access 2003.So FindOut the Provider for Ms-Access 2010.I hope it will Solve your Problem.


这篇关于任何CPU平台和X86平台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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