0

While migrating from mq dot client 1.0 to mq 8.0.0.4, receiving following error when call mq manager is made.

call is made from a script task from ssis 2012 package. call to mq manager works when called from a windows service.

 Inner Exception : 
System.IO.FileLoadException: Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542)
File name: 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.IO.FileLoadException: Could not load file or assembly 'System.Web`enter code here`, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542)
File name: 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

=== Pre-bind state information ===
LOG: DisplayName = System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files/Microsoft SQL Server/110/DTS/Binn/
LOG: Initial PrivatePath = NULL
Calling assembly : amqmdnet, Version=9.0.0.3, Culture=neutral, PublicKeyToken=dd3cb1c9aae9ec97.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files\Microsoft SQL Server\110\DTS\Binn\DTExec.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Version redirect found in framework config: 2.0.0.0 redirected to 4.0.0.0.
LOG: Post-policy reference: System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

   at IBM.WMQ.CommonServices.GetPropertyValue(String propertyName, Boolean tryEnvironment)
   at IBM.WMQ.CommonServices.CreateCommonServices()
   at IBM.WMQ.CommonServices.TraceConstructor(String objectId, String sccsid)
   at IBM.WMQ.Nmqi.NmqiEnvironment..ctor(NmqiPropertyHandler nmqiPropertyHandler)
   at IBM.WMQ.Nmqi.NmqiFactory.GetInstance(NmqiPropertyHandler properties)
   at IBM.WMQ.MQQueueManager..cctor()


 Stack Trace : 
   at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, Hashtable properties)
   at CIBC.CTS.PMI.MQ.MQConnection.Connect(String hostName, Int32 port, String queueManagerName, String channelName, String replyQueueManagerName, String mqIdentity)
 Message : 
The type initializer for 'IBM.WMQ.MQQueueManager' threw an exception.
 Source : 
amqmdnet

Edit: have tried installing version 9.0.0.3 too as 8.0.0.4 had know issue with unmanaged code calling mq, but that did not work. could this issue be due to version redirector as per the binding log? LOG: Version redirect found in framework config: 2.0.0.0 redirected to 4.0.0.0.

Or related to Impersonation from SSIS script task? Impersonaltion level is shown as "Identification"

  • Can you give more information about how exactly it is called? – Tim Woocker Apr 02 '18 at 10:47
  • Script task in the ssis pacakge calls a method from a common dll in gac, which in tern calls MQQueueManager below is the call _queueManager = new MQQueueManager(queueManagerName, qmProperties); – nitin Sane Apr 02 '18 at 10:50
  • Is the install of MQ 8.0.0.4 and 9.0.0.3 set as the Primary install? If not try it with it set as the Primary install. Have you attempted to recompile the app under the new MQ version? – JoshMc Apr 02 '18 at 14:49
  • I think the problem here is with SSIS (SQL Server Integration Service) which I believe runs it's own miniature version (if I can call it) of .NET Framework, not finding System.Web assembly. MQ .NET 8.x uses some functions from System.Web assembly. My suggestion would be to register System.Web assembly with SSIS and try. Some useful link on registering assembly with SQL Server: https://learn.microsoft.com/en-us/sql/relational-databases/clr-integration/assemblies/creating-an-assembly – Shashi Apr 02 '18 at 14:57
  • Hi @joshMc, yes MQ Version 9.0.0.3 is set as primary install and have recompiled my code with the same amqmdnet dll from server. – nitin Sane Apr 02 '18 at 14:58
  • Hi @Shashi, SSIS services are running on a different box than SQL Server. , is there some other way to register system.web for SSIS other than CLR in SQL Server. – nitin Sane Apr 02 '18 at 15:02
  • No, I am not aware. am not a SQL server guy. – Shashi Apr 03 '18 at 04:29

0 Answers0