Nik's Technology Blog

Travels through programming, networks, and computers

Debugging Alterian CMC / Immediacy Plug-ins

Debugging an Alterian CMC/Immediacy plug-in isn’t that straight forward because when they don’t work there isn’t an easy way for a developer to determine the problem.

In the Editor you generally get an unhelpful pop-up message like this:

immediacy editor error

Which also means none of the plug-ins will be available for use.

There is an CMC log file that can be viewed by navigating to the following path on your web server.

C:\Program Files\Alterian\CMC 6.2\CMS\Logging\ViewLogFile.xml

immediacy-logs

But this isn’t as helpful as it may seem because if a plug-in has errors then they won’t generally get logged here or anywhere else it seems.

The other tool you have at your disposal is a special plug-ins page that enumerates the plug-ins installed or throws an error when one has broken.  This error can sometimes lead you to a fix for the problem.

Open Internet Explorer on your web server and navigate to:

http://localhost/_immediacy/editor/plugins.ashx

Note: This will only work locally on the web server, and will return some XML defining the properties for each installed plug-in.

immediacy-plugins

Ambiguous DLLs

We’ve just been testing an upgrade our CMS and come across a few problems concerning newer versions of assemblies interfering with older versions stored in the GAC.

The solution is to use a binding redirect in Web.Config to tell the framework to use the latest version.  For more info see Redirecting Assembly Versions.

   1: <runtime>
   2:   <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
   3:     <dependentAssembly>
   4:       <assemblyIdentity name="Immediacy.Web" publicKeyToken="b35b2a186fcebe46"/>
   5:       <bindingRedirect oldVersion="6.1.0.0" newVersion="6.2.0.0"/>
   6:     </dependentAssembly>
   7:   </assemblyBinding>
   8: </runtime>

To get the publicKeyToken for the DLL you need to open a Visual Studio command prompt and navigate to the folder containing the DLL and type:

SN –T assemblyname.dll

This will give you the publicKeyToken to put in the assembly identity.

Alternatively you could remove the old version of the DLL from the GAC by using this command with the Global Assembly Cache Tool

gacutil /u Immediacy.Web, Version=6.1.0.0, Culture="en",PublicKeyToken=b35b2a186fcebe46