2010-10-01 4 views
1

Je suis en train de développer un service WCF simple fonctionnant dans un environnement 64 bits. Je lance VS2010 sous Windows 7WCF 64 bits ne fonctionne pas

Nouvelle solution -> projet WCF -> Exécuter -> Cela fonctionne très bien.

Dès que je change les propriétés du projet afin de faire compiler en 64 bits, en cours d'exécution, il jette l'exception suivante:

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

Avec l'Assemblée suivante charge 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. 

Comment puis-je surmonter le problème? Une idée? Merci

EDIT:

Le WCF ne compile après avoir défini la cible de la plate-forme à AnyCPU, mais je dois mettre spécifiquement une compilation 64 bits parce que je travaille avec des objets SharePoint et un AnyCPU (ou x86) résultats de compilation dans le même problème et l'erreur décrite here (et dans d'autres endroits sur le net). Donc, soit je compile AnyCPU/x86 et j'obtiens une erreur de l'intégration avec SharePoint ou je mets la plate-forme cible à 64 bits et j'obtiens une erreur de WCF.

+0

Avez-vous déjà utilisé le service sous 64 bits? J'ai le même problème. – Josh

+0

Avez-vous résolu ce problème? s'il vous plaît laissez-moi savoir –

Répondre

2

Votre assembly WcfService2 est-il marqué avec Platform Target == x86? Vous devriez essayer de vous assurer qu'il est compilé à Any CPU à la place. Vous trouverez ce paramètre dans la page Générer des paramètres du projet Visual Studio.

+0

Salut, merci pour votre commentaire, mais cela ne résout toujours pas le problème comme je l'ai décrit dans la section EDIT ci-dessus – pistacchio

+2

Le code d'erreur que vous obtenez signifie que "Une tentative a été faite pour charger un programme avec un format incorrect. ". Cela suggère, pour moi, que vous dépendez probablement d'une bibliothèque qui n'est pas x64, et qui cause le problème. Etes-vous sûr que toutes vos références sont AUCUN processeur ou x64? – tomasr

2

Accédez aux paramètres avancés du pool d'applications. Définissez "Activer les applications 32 bits" sur true

Questions connexes