Recently, we have released a k2.net 2003 workflow into production that uses a C#.Net dll to hold database and some custom functionality. Initially all the workflows were using the same dll locally, but with the new workflow release we have signed the assembly and kept in GAC. With this change the new workflows working fine but the other existing workflows going to error state as they were developed to use the dll locally and it was not signed dll. Finally created a ticket with K2 to get ther support and they solved the problem with one hot fix.
Error Description:System.IO.FileLoadException: Could not load file or assembly 'K2Classes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'K2Classes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' at K2Code11748..ctor()
Resolution: The assembly, K2Classes.dll, for the existing processes was referenced locally in K2 Studio in which case it gets serialized to the K2 database when the process is exported, and then gets extracted to the \work\[procid] directory at runtime. The assembly was recently signed and referenced from the GAC for a new process, then installed in the GAC and the \K2.net 2003\bin directory on the server. The new process is working but the older processes are trying to use the new version of the dll and failing.
"If the assembly is copied to the \k2.net 2003\bin directory, all process instances, regardless of how the custom assembly is referenced in the Studio project (GAC or locally), will always use the assembly in the \K2.net 2003\bin directory."
Stopped the K2 service, removed the K2Classes.dll from the \k2.net 2003\bin directory, restarted the service and able to repair the existing instances, but then the instances of the new process started failin with the following error even though the dll is still in the GAC: 5015 Unhandled Exception in Code Item LineRule - Default1 : 4116 Error Compiling Process : 4116 Error Compiling Process : Compile Error: Imports Line 0: Metadata file 'K2Classes.dll' could not be found
The new process was not picking up the assembly from the GAC due to a known bug that is fixed in hotfix 2. After installing the hotfix, we were able to repair the new process instances successfully and confirmed that the process instances from the older are working fine.
Really thanks to K2 Ssupport to solve this issue on production.
Error Description:System.IO.FileLoadException: Could not load file or assembly 'K2Classes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'K2Classes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' at K2Code11748..ctor()
Resolution: The assembly, K2Classes.dll, for the existing processes was referenced locally in K2 Studio in which case it gets serialized to the K2 database when the process is exported, and then gets extracted to the \work\[procid] directory at runtime. The assembly was recently signed and referenced from the GAC for a new process, then installed in the GAC and the \K2.net 2003\bin directory on the server. The new process is working but the older processes are trying to use the new version of the dll and failing.
"If the assembly is copied to the \k2.net 2003\bin directory, all process instances, regardless of how the custom assembly is referenced in the Studio project (GAC or locally), will always use the assembly in the \K2.net 2003\bin directory."
Stopped the K2 service, removed the K2Classes.dll from the \k2.net 2003\bin directory, restarted the service and able to repair the existing instances, but then the instances of the new process started failin with the following error even though the dll is still in the GAC: 5015 Unhandled Exception in Code Item LineRule - Default1 : 4116 Error Compiling Process : 4116 Error Compiling Process : Compile Error: Imports Line 0: Metadata file 'K2Classes.dll' could not be found
The new process was not picking up the assembly from the GAC due to a known bug that is fixed in hotfix 2. After installing the hotfix, we were able to repair the new process instances successfully and confirmed that the process instances from the older are working fine.
Really thanks to K2 Ssupport to solve this issue on production.
No comments:
Post a Comment