This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice This article is not considered official documentation for K2 software and is provided “as is” with no warranties.

Issue

Could not load file or assembly 'SourceCode.EventBus.EventAssemblies.dll' - when deploying from K2 Studio the invalid SourceCode.EventBus.EventAssemblies.dll is loaded in the K2 Database.

Image

Symptoms

The problem occurs when you install K2 on a drive that is not where the OS is and it uses the path [INSTALLDIR] instead of the full path.

The most probable cause is the error that is reported as "Could not load file or assembly '[INSTALLDIR]Host Server\\Bin\\SourceCode.EventBus.EventAssemblies.dll' or one of its dependencies."

Troubleshooting Steps

Complete the following steps to fix the error:

Please ensure that you stop the K2 Blackpearl server services and make a backup of the database and config files prior to performing the following.

Also, please update the [Drive letter:] to the drive letter where K2 Blackpearl is installed.

In K2Hostserver.config update mailassembly and mailassemblytype pointed to the wrong .dll

• Update the mailassembly to point to [Drive letter:]\Program Files (x86)\K2 Blackpearl\Host Server\Bin\SourceCode.EventBus.MessageBusRecorder.dll instead of [INSTALLDIR]Host Server\Bin\SourceCode.EventBus.EventAssemblies.dll'

• Update to point to SourceCode.EventBus.MessageBusRecorder.MessageBusMailer instead of SourceCode.EventBus.EventAssemblies.Mail.

New Config:

<sourcecode.eventbus mailassembly="C:\Program Files (x86)\K2 blackpearl\Host Server\Bin\SourceCode.EventBus.MessageBusRecorder.dll" mailassemblytype="SourceCode.EventBus.MessageBusRecorder.MessageBusMailer" mailmethodsignature="Void SendMail(System.String, System.String, System.String, System.String, System.String, System.String, Boolean, System.String)" notificationtemplatepath="C:\Program Files (x86)\K2 blackpearl\Host Server\Bin\SourceCode.EventBus.ClientRecorder.DLL.mailTemplate" eventbusserverdependencies="SourceCode.SmartObjects.Runtime.SmartObjectClientServer,
SourceCode.SmartObjects.Runtime.SmartObjectManagementServer" msmqpath=".\Private$\EventBus"
msmqerrorpath=".\Private$\EventBus Error" eventqueuingassembly="SourceCode.EventBus.MSMQSource.dll"
eventqueuingtype="SourceCode.EventBus.MSMQSource.MessagesFromSource" eventbuffersize="25"
eventpollinginterval="60" getschedulesinterval="60" sendmailfrom="system@k2.local">

Old Config:
<sourcecode.eventbus mailassembly="C:\Program Files (x86)\Host Server\Bin\SourceCode.EventBus.EventAssemblies.dll" mailassemblytype="SourceCode.EventBus.EventAssemblies.Mail" mailmethodsignature="Void SendMail(System.String, System.String, System.String, System.String, System.String, System.String, Boolean, System.String)" notificationtemplatepath="C:\Program Files (x86)\K2 blackpearl\Host Server\Bin\SourceCode.EventBus.ClientRecorder.DLL.mailTemplate" eventbusserverdependencies="SourceCode.SmartObjects.Runtime.SmartObjectClientServer,
SourceCode.SmartObjects.Runtime.SmartObjectManagementServer" msmqpath=".\Private$\EventBus"
msmqerrorpath=".\Private$\EventBus Error" eventqueuingassembly="SourceCode.EventBus.MSMQSource.dll"
eventqueuingtype="SourceCode.EventBus.MSMQSource.MessagesFromSource" eventbuffersize="25" eventpollinginterval="60" getschedulesinterval="60" sendmailfrom="system@k2.local">

2. On the DB:

Please contact K2 Technical Support for assistance in updating the Database directly.

Then update the design template and redeploy. The issue should be resolved.