如何在 32 位模式下编译 WCF 服务库? [英] How do I compile a WCF Service Library in 32-bit mode?

查看:25
本文介绍了如何在 32 位模式下编译 WCF 服务库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以从基于 x86 的项目中引用 Matlab 代码,但不能从 x64 项目中引用.

I can reference Matlab code from a x86 based project, but not from an x64 project.

我可以将 WCF 服务构建为任何 CPU",但不能构建为 x86.当我尝试仅构建为 x86 时,出现以下错误:

I can build the WCF Service as "Any CPU", but not x86. When I attempt to build as x86 only, it gives the following error:

---start error---
System.BadImageFormatException: Could not load file or assembly 'file:///D:\backtest\WcfServiceLibrary.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
---end error---

因此,我被困住了:我到底如何通过 WCF 提供 Matlab 调用?它就像某种奇怪形式的开发者异或.

Thus, I'm stuck: how on earth do I provide Matlab calls via WCF? Its like some weird form of developers XOR.

关于如何 (a) 以 32 位模式编译 WCF 服务库,或 (b) 解决该问题的任何想法?

Any ideas on how to either (a) compile the WCF Service Library in 32-bit mode, or (b) work around the issue?

我有 Win7 x64,MSVS 2010.

I have Win7 x64, MSVS 2010.

推荐答案

WcfServiceLibrary 是一个 DLL,因此应该构建为Any CPU".只有托管所有其他 DLL 的 EXE 项目需要根据需要标记为x86"或x64".在这种情况下,EXE 是哪个项目?

WcfServiceLibrary is a DLL, so should be built as "Any CPU". Only EXE projects hosting all the other DLLs need to be marked as "x86" or "x64" as required. Which project is the EXE in this case?

这篇关于如何在 32 位模式下编译 WCF 服务库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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