You might come across the following error when trying to create a new package using Package and Deployment tool.
"System.TypeInitializationException: The type initializer for 'SourceCode.SmartObjects.ServiceBrokerStore.Store' threw an exception. ---> System.MissingMethodException: Method not found: 'Int32 SourceCode.SmartObjects.Configuration.SmartObjectsRuntimeConfigurationSection.get_StoreCacheDurationSeconds()'. at SourceCode.SmartObjects.ServiceBrokerStore.Store.InitializeCache() at SourceCode.SmartObjects.ServiceBrokerStore.Store..cctor() --- End of inner exception stack trace --- at SourceCode.Hosting.Client.BaseAPI.BaseAPIConnection.RemoteCall(String TypeName, String MethodName, Object Parameters, Boolean NullList, MarshalMessageType CallType) at SourceCode.Deployment.Management.PackageDeploymentManager.CreateSession(String sessionName) at SourceCode.Management.SnapIns.K2Management.K2ServerFarm.CreatePackage()"
- This issue can happen when Windows updates are not installed correctly.
- Restarting the K2 Server doesn't fix the issue.
To troubleshoot the issue, please follow the steps below:
- Verify if you are able to "Edit Package" and "Deploy Package".
- Perform an IIS RESET to see if you're able to 'Create Package".
- Verify if any Cumulative Updates (CU) or FixPacks (FP) have been installed lately under "HostServer.UpdateHistory" table in the SQL database.
- Check if there are any available Windows updates that are to be installed by clicking 'Check for Updates'.
- If you see any update on 'Windows Updates," please click 'Install' to install the updates manually.
- Wait for the updates to complete.
- Once the updates are completely installed, the server reboots.
- It's going to take a while to do the backend process with Windows update installation.
- Check if you are able to 'create package' using Package and Deployment tool once the server's rebooted successfully.
- The error appears to have gone away by just manually installing the Windows Updates.
- The issue should now be resolved.