PowerShell from .NET calling MsmqQueueManager

0

I have a simple PowerShell script which I am trying to call from .NET (vb.net) using the PowerShell.Create method to create the pipeline. The script just calls Set-MsmqQueueManager. The code works fine on my development machine, however, on the Windows Server 2012 R2 server I deploy it to Powershell returns the following error in the error streams:

System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Msmq.Runtime.Interop.dll' or one of its dependencies. A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A) File name: 'Microsoft.Msmq.Runtime.Interop.dll' at Microsoft.Msmq.PowerShell.Commands.SetMSMQQueueManagerCommand.BeginProcessing() at System.Management.Automation.Cmdlet.DoBeginProcessing() at System.Management.Automation.CommandProcessorBase.DoBegin()

I have tried various Import-Module statements, I have tried including the System.Messaging.dll and even using it to Add-Type but nothing has worked so far. I can run other scripts in this manner without any issues.

Any insights would be greatly appreciated, thanks.

powershell
asked on Stack Overflow Oct 6, 2015 by Ian Elsinga

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0