When trying to design a RunBook using Active Directory Integration Pack 7.0, it fails with error "Failed to load the assembly containing the service class."

IMPORTANT: Allways perform a FULL Backup of the database before doing anything to it !!!

ALSO: It is advised that you open a case at Microsoft before doing this - directly editing the database is not supported and you may find yourself in an unsupported state if anything goes wrong.

 

Installed System Center Orchestrator 2012 RTM a couple of days ago and then wanted to build a RunBook using the Active Directory Integration Pack. Ok, no worries, I installed the Active Directory 7.0 BETA Integration Pack - that was available at the time ... and everything worked, no problem :D

But today I needed to work with it again and found out that the Active Directory 7.0 RTM Integration Pack is out so I un-deployed the BETA AD IP and un-registerd it. After this I have registered and deployed the RTM version which is available here.

Now then, let's create a new RunBook and then create the AD Conenction via the Active Directory Configuration wizard.

Well what do you know? Doesn't work anymore ... now I'm getting a strange error as if something went wrong with the install of the IP:

Failed to load the assembly containing the service class.

 Hmm ... it seams that it doesn't find the right assembly or some class in the assembly. The names of the DLLs and Classes (actual IP objects used in the designer) out of DLLs of the Integration Packs are stored in the Orchestrator database in the table CONFIGURATION.

Ok so after checking the GAC I found out that the name of the AD IP DLL for example is: Microsoft.SystemCenter.IntegrationPack.ActiveDirectory.dll

Now let's check the database - so I ran this SQL query on the Orchestrator database (the GUID used it of the AD IP DLL):

 SELECT DataValue<br>FROM CONFIGURATION<br>WHERE<br>   TypeGUID = '796D217E-1BF5-4C4A-8336-18B5BFD00092' 

 

 Well looking at the results we can see that we have different names in the database for the DLL ... and this means that it will be a different name for all the objects (Classes) as well ...

  <configurationtypes><br>   <configurationtype><br>      <name>ActiveDirectoryConfiguration</name><br>      <library>796d217e-1bf5-4c4a-8336-18b5bfd00092\Microsoft.SystemCenter.Orchestrator.ActiveDirectoryIP.dll</library><br>      <class>Microsoft.SystemCenter.Orchestrator.ActiveDirectoryIP.ActiveDirectoryConfiguration</class><br>      <description></description><br>   </configurationtype><br></configurationtypes> 

 

 The name of the DLL and the starting string for the Class names in the RTM 7.0 AD IP is:

Microsoft.SystemCenter.IntegrationPack.ActiveDirectory.*

but the strings found in the database match the names used for the BETA 7.0 AD IP:

Microsoft.SystemCenter.Orchestrator.ActiveDirectoryIP.*

 

 So I've written this SQL query that will set the correct names for the DLL and all Classes inside the Orchestrator database and executed it:

 DECLARE<br>   @UniqueId UNIQUEIDENTIFIER,<br>   @DataValue NVARCHAR(MAX),<br>    @OldName NVARCHAR(255),<br>   @NewName NVARCHAR(255)<br>SET @OldName = N'Microsoft.SystemCenter.Orchestrator.ActiveDirectoryIP.'<br>SET @NewName = N'Microsoft.SystemCenter.IntegrationPack.ActiveDirectory.'<br>DECLARE WorkCursor CURSOR LOCAL FORWARD_ONLY READ_ONLY FOR<br>   SELECT<br>       UniqueID,<br>      DataValue<br>   FROM CONFIGURATION<br>   WHERE DataValue LIKE '%' + @OldName + '%'<br>OPEN WorkCursor<br>FETCH NEXT<br>FROM WorkCursor<br>INTO<br>   @UniqueId,<br>   @DataValue<br>WHILE @@FETCH_STATUS = 0 BEGIN<br>    UPDATE CONFIGURATION<br>   SET DataValue = REPLACE(@DataValue, @OldName, @NewName)<br>   WHERE UniqueID = @UniqueId<br>   FETCH NEXT<br>   FROM WorkCursor<br>   INTO<br>      @UniqueId,<br>      @DataValue<br>END<br>CLOSE WorkCursor<br>DEALLOCATE WorkCursor

 

 

Now the Active Directory Integration Pack 7.0 RTM is working and I'm not getting those strange errors about not finding assemblies and stuff ... cool huh?! :D