简体   繁体   中英

How about .Net project needs to build under both x64 and x86?

My small application does 2 things seem conflict:

1) Use VFPOLEDB.1 to talk to Visual Foxpro database to get some data --> It require app builder in x86 or 'Any CPU'

2) However there is another function to call a powershell script to access IIS of the server and it requires project build in x64. (or when .Net launch powershell, it gets confused about which version and will throw some COM object class not register error)

How can I handle this conflict issue?

I'm not entirely sure, but perhaps you can do this by splitting your project. One project is x86 and does the FoxPro call, the other one is x64 and calls Powershell, a third one would be the main project that calls the two.

Per Microsoft:

The VFP oledb driver is 32 bit and can not be used with the NET 2.0 CLR running in 64 bit mode. It is my understanding that there are no plans to provide a 64 bit version of the VFP oledb driver. [Source]

In short, you're not going to ever be able to use it in 64-bit mode; work out trying to solve your COM object error and build for x86. Your other option might be to generate a standalone executable for the FoxPro section and have your main app execute it independently (it would end up being virtualized though).

我认为对此的另一种选择是使用COM +和后期执行模型,其中COM对象实际上由COM +服务器而不是直接由您的应用程序管理。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM