问题描述
我想开发一个64位环境中运行一个简单的WCF服务。我火了VS2010在Windows 7
I'm trying to develop a simple WCF service running in a 64 bit environment.I fire up VS2010 under Windows 7
新解 - > WCF项目 - >运行 - >它正常工作
New Solution -> WCF project -> Run -> It works fine.
当我改变,以使其在64位编译该项目的性质,运行它抛出以下异常:
As soon as I change the properties of the project in order to make it compile in 64 bit, running it throws the following exception:
Could not load file or assembly 'WcfService2' or one of its dependencies.
通过以下程序集加载跟踪
With the following Assembly Load Trace
=== Pre-bind state information ===
LOG: User = *****
LOG: DisplayName = WcfService2
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: WcfService2 | Domain ID: 4
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///d:/temp/WcfService2/WcfService2/
LOG: Initial PrivatePath = d:\temp\WcfService2\WcfService2\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: d:\temp\WcfService2\WcfService2\web.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/806f4cb8/df40e9e2/WcfService2.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/806f4cb8/df40e9e2/WcfService2/WcfService2.DLL.
LOG: Attempting download of new URL file:///d:/temp/WcfService2/WcfService2/bin/WcfService2.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
我怎样才能解决这个问题呢?任何想法?谢谢
How can I overcome the problem? Any idea? Thanks
编辑:
在WCF的确实的编译平台目标设置为值为anycpu后,但我需要专门设置一个64位编译,因为我的工作与SharePoint对象和值为anycpu(或x86)编译的结果非常相同的问题和错误描述这里(而在其他地方在网络上)。
The WCF does compile after setting the Platform Target to AnyCPU, but I need to specifically set a 64 bit compilation because I'm working with SharePoint objects and a AnyCPU (or x86) compilation results in the very same problem and error described here (and in other places on the net).
因此,无论我编译值为anycpu / x86和我得到与SharePoint集成中的错误或我设定的目标平台到64位,我从WCF得到一个错误。
So either I compile AnyCPU/x86 and I get an error from the integration with SharePoint or I set the target platform to 64 bit and I get an error from WCF.
推荐答案
浏览到应用程序池的高级设置。设置启用32位应用程序为true
Browse to Advanced Settings of Application Pool.Set "Enable 32-bit Applications" to true
这篇关于WCF 64位不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!