Quantcast
Channel: Chilkat Tech Notes
Viewing all articles
Browse latest Browse all 415

Add-Type PowerShell Error for ChilkatDotNet47.dll

$
0
0

Problem:   The following command:

Add-Type -Path "C:\chilkat\ChilkatDotNet47-9.5.0-x64\ChilkatDotNet47.dll"

results in the following errors when attempting to run in PowerShell:

+ Add-Type -Path"C:\chilkat\chilkatdotnet47-9.5.0-x64\ChilkatDotNet47.d ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidData : (Microsoft.Power...peCompilerError:AddTypeCompilerError) [Add-Type], Exception
+ FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand
Add-Type : Impossible d'ajouter un type. Des erreurs de compilation se sont produites.
Au caractère C:\ProgramData\C1B2.ps1:1 : 1
+ Add-Type -Path"C:\chilkat\chilkatdotnet47-9.5.0-x64\ChilkatDotNet47.d ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidData : (:) [Add-Type], InvalidOperationException
+ FullyQualifiedErrorId : COMPILER_ERRORS,Microsoft.PowerShell.Commands.AddTypeCommand 
New-Object : Le type [Chilkat.Global] est introuvable : vérifiez que l'assembly dans lequel il se trouve est chargé.
Au caractère C:\ProgramData\C1B2.ps1:2 : 7
+ $glob=New-Object Chilkat.Global
+       ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidType: (:) [New-Object], PSArgumentException
+ FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand
Impossible d'appeler une méthode dans une expression Null.
Au caractère C:\ProgramData\C1B2.ps1:3 : 1
+ $success=$glob.UnlockBundle("...")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation : (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Solution:

Il faut aller dans les propriétés de votre DLL et cocher « Débloquer » et là cela fonctionne parfaitement

(You have to go to the properties of your DLL and check “Unblock” and there it works perfectly)


Viewing all articles
Browse latest Browse all 415

Trending Articles