2010-10-01 66 views
1

我正试图开发一个简单的WCF服务在64位环境中运行。 我火了VS2010的Windows 7WCF 64位不工作

新方案下 - > WCF项目 - >运行 - >它工作正常。

只要我改变项目的性质,以使其在64位编译,运行它抛出以下异常:

Could not load file or assembly 'WcfService2' or one of its dependencies. 

用下面的程序集加载跟踪

=== 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. 

我该如何克服这个问题?任何想法?由于

编辑:

的WCF 编译平台目标设置为AnyCPU后,但我需要,因为我与SharePoint对象和AnyCPU合作,专门设置一个64位编译(或x86)的编译导致了与here(以及网络上的其他地方)中描述的相同的问题和错误。

因此,无论我编译AnyCPU/x86和我从与SharePoint的整合得到一个错误,或者我的目标平台设置为64位和我从WCF错误。

+0

你有没有得到在64位上运行的服务?我有完全相同的问题。 – Josh 2011-09-22 15:39:03

+0

你解决了这个问题吗?请让我知道 – 2012-02-29 11:11:30

回答

2

标有平台目标== 86你WcfService2组装?您应该尝试确保将其编译为任何CPU。您可以在Visual Studio项目设置的“生成”页面中找到此设置。

+0

您好,感谢您发表评论,但是这仍然是我在EDIT部分如上所述 – pistacchio 2010-10-01 12:57:11

+2

你得到这个手段“试​​图加载程序因错误代码不解决问题不正确的格式“。这表明,对我来说,你可能依赖于不是x64的库,这是造成麻烦的原因。你确定所有的引用都是任何CPU或x64? – tomasr 2010-10-01 14:49:28

2

浏览应用程序池的高级设置。 设置了“启用32位应用程序”为true

相关问题