Symptoms
After migration of a Production K2 server to a new Dev environment (Mainly done with SQL export/import), lot of smart object are not valid.
Error when trying to acces to the Smart object:
Root element is missing SourceCode.HostServerLib
In French: erreur "?l?ment racine manquant, Source : SourceCode.HostServerLib"
Diagnoses
This type of issue could appears if the Service instance system name and corresponding GUID defined in the Smart object not correspond to the current Service instance.
Resolution
Method A (Only with SmartObject Service tester):
1 - With Smart object service tester, do a "View XML"
2 - Click on "..." button of "Methods (Collection)"
3 - Select the Method in the left screen
4 - Click on "..." button of "ExecutionBlocks (Collection)"
5 - Expand ServiceInstance and note the GUID and Name properties (Display name is not very important)
6 - Close all these windows
7 - Open ServiceObject Explorer
8 - Select the corresponding Service Instance
9 - Right click and click on "Register Service Instance", fill all necessary parameter according your environment.
10 - Click on Next button
11 - Put any value for the Display Name, For System Name and GUID, put the value of step 5.
Method B (SmartObject Service tester and NotePad++):
1 - With Smart object service tester, do a "View XML"
2 - Copy all the content of the XML (Starting by "