Solving [A]SourceCode.SmartObjects.Configuration.SmartObjectsRuntimeConfigurationSection cannot be cast to [B]SourceCode.SmartObjects.Configuration.SmartObjectsRuntimeConfigurationSection
K2 Automated Testing Software
rnBenchQA allows full test automation of K2, including fully automated K2 SmartForms and K2 Workflow testing. It promotes test driven development for K2 and ensures continued quality assurance for K2 solutions. Easily apply changes to test cases to accommodate changes to K2 apps and ensure all apps are regression tested to avoid defects and assure continuous quality.
After upgrading to K2 4.6.9 and opening the K2 Package and Deployment program, I got the error below.
[A]SourceCode.SmartObjects.Configuration.SmartObjectsRuntimeConfigurationSection cannot be cast to [B]SourceCode.SmartObjects.Configuration.SmartObjectsRuntimeConfigurationSection. Type A originates from ‘SourceCode.SmartObjects.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=16a2c5aaaa1b130d’ in the context ‘Default’ at location ‘C:Program Files (x86)K2 blackpearlHost ServerBinSourceCode.SmartObjects.Configuration.dll’. Type B originates from ‘SourceCode.SmartObjects.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=16a2c5aaaa1b130d’ in the context ‘LoadFrom’ at location ‘C:Program Files (x86)K2 blackpearlServiceBrokerSourceCode.SmartObjects.Configuration.dll’
It looks like the assemblies are loaded with the default load and load-from context respectivly. The differences are explained here.
After looking for a solution for ages, someone suggested overwriting the assembly in the ServiceBroker dicetory with the one in the HostServerbin directory. I backed up the K2 instance and overwrote the assembly as suggested above and restarted K2. When I went into the K2 Package and Deployment Management Console, it worked fine and I deployed by K2 solution.
I am yet to figure out if this is a bug or not, and I will have a word with one of the K2 support engineers to get a better idea of the root cause of this issue.