2017-01-16 9 views
0

Pourquoi Add-Type ne fonctionne pas avec l'assembly BizTalk 2010 Microsoft.BizTalk.ExplorerOM?Pourquoi Add-Type ne fonctionne pas avec l'assembly BizTalk 2010 Microsoft.BizTalk.ExplorerOM?

si je charge l'ancienne par réflexion ...

[void] [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.BizTalk.ExplorerOM") 

Mais j'utiliser la bonne façon avec Add-Type ...

Add-Type -AssemblyName Microsoft.BizTalk.ExplorerOM 

Je je peux heureusement travailler les objets ExplorerOM obtenir la Erreur cannot add type ...

Add-Type : Cannot add type. The assembly 'Microsoft.BizTalk.ExplorerOM' could not be found. 
At E:\loadexplorerom.ps1:5 char:1 
+ Add-Type -AssemblyName Microsoft.BizTalk.ExplorerOM 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : ObjectNotFound: (Microsoft.BizTalk.ExplorerOM:String) [Add-Type], Exception 
    + FullyQualifiedErrorId : ASSEMBLY_NOT_FOUND,Microsoft.PowerShell.Commands.AddTypeCommand 

J'ai vérifié mon GAC et le BizTalk 2010 ExplorerOM est là-dedans ...

Microsoft.BizTalk.ExplorerOM, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL 
+1

Possible [dupliquer] (http://stackoverflow.com/questions/3621900/how-do-i-use-add-type-to-load-microsoft-web-deployment) Que se passe-t-il lorsque vous utilisez Add- Tapez avec le nom complet ou le chemin dll? – BenH

Répondre

2

PowerShell est très limitée dans le jeu de chargement prédéfini d'ensembles avec leur nom partiel.

Dans votre cas, c'est pareil. Vous devez indiquer à powershell de charger cet assembly particulier pour le serveur Biztalk.

En d'autres termes, vous devez donner le chemin complet du dll:

Exemple:

Add-type -Path C: \ assembly Windows \ Microsoft.NET \ \ GAC_64 \ System.Web \ v4.0_4.0 .0.0__b03f5f7f11d50a 3a \ System.Web.dll

Essayez d'ajouter cela aussi:

Add-Type -AssemblyName ('Microsoft.BizTalk.ExplorerOM, Version=3.0.1.0, ' + 'Culture=neutral, PublicKeyToken=31bf3856ad364e35' + 'processorArchitecture=MSIL')