简体   繁体   English

WCF服务参考更新失败

[英]WCF Service Reference Update Fails

I'm new to WCF and I want to update the service reference. 我是WCF的新手,我想更新服务参考。 However, I get the message: "Could not load file or assembly 'ManageDHCP' or one of its dependencies. An attempt was made to load a program with an incorrect format." 但是,我收到消息:“无法加载文件或程序集'ManageDHCP'或其依赖项之一。试图加载格式错误的程序。” when I try right clicking the service reference in Visual Studio 2013 > Update Service Reference. 当我尝试右键单击Visual Studio 2013中的服务参考>更新服务参考时。

Before I was using 32-bit ManageDHCP.dll in my service; 在服务中使用32位ManageDHCP.dll之前; however I found out that I needed to use the 64-bit ManageDHCP.dll so I went and replaced that then configured the build's platform target and platform of the service to x64 which by itself builds fine. 但是我发现我需要使用64位的ManageDHCP.dll,所以我去了并替换了它,然后将构建的平台目标和服务平台配置为x64,它本身可以很好地构建。 Why does it still fail though? 为什么它仍然失败?

So the answer was was that I was running Visual Studio 2013, which apparently the default when you install is set to run IIS Express (32-bit version). 答案是我运行的是Visual Studio 2013,显然安装时的默认设置为运行IIS Express(32位版本)。 This has issues when you have 64-bit projects/dlls. 当您有64位项目/ dll时,这会出现问题。

I fixed this by going up to the menus and checking the box for: 我通过转到菜单并选中以下框来解决此问题:

Tools | 工具| Options | 选项| Projects and Solutions | 项目和解决方案| Web Projects | 网络项目| Use the 64 bit version of IIS Express… 使用IIS Express的64位版本…

Further reading: http://blogs.msdn.com/b/rob/archive/2013/11/14/debugging-vs2013-websites-using-64-bit-iis-express.aspx 进一步阅读: http : //blogs.msdn.com/b/rob/archive/2013/11/14/debugging-vs2013-websites-using-64-bit-iis-express.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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