SaveOptionsConfiguration doesn't save options

Hello,

I trying to save options using

Configuration.Instance.SaveOptionsConfiguration(MyPluginId, false, x);

There are no exceptions but I found the message in VS output window:

MIP: Error: LoginServerSvc.SetCustomSettingData ():Unable to update or save for id=…my plugin guid…

What does it mean?

Is there a way to get a return code or exception in my code to be able to analyze the result of saving options?

And the MAIN question - why it happened? This code worked successfully for a long time but the issue happened today…

UPDATED:

There is some data stored by MyPluginId. I see it using ConfigAPIClient.exe (from MIPSDK samples). But the GetOptionsConfiguration in my code doesn’t return it.

Regards,

Alex.

Hello Alex,

Can you please test unmodified Property sample and see if the same has the same issue?

https://doc.developer.milestonesys.com/html/index.html?base=samples/property.html&tree=tree_search.html?search=property

Also, I ran into this question, I am not sure if it is helpful but please see the last comment from the thread - https://developer.milestonesys.com/s/question/0D53X00007P1SWmSAN/settingpanelcontrol-not-displayed

Hello @Rie Kiuchi (Milestone Systems)​

>> Can you please test unmodified Property sample and see if the same has the same issue?

I tested it and there are no issues with the unmodified code.

But when I changed the original GUID to the MyPluginId - I got the same issue, namely:

  • on GetOptionsConfiguration I got

instead of my own data that is actually stored there.

  • on SaveOptionsConfiguration I got

MIP: Error: LoginServerSvc.SetCustomSettingData ():Unable to update or save for id=… my plugin guid…

in the IDE output window and nothing in the program.

I’ve tested the way from the ConfigAPIClient.exe:

private void button3_Click(object sender, EventArgs e)
{
	MIPKindFolder folder = new MIPKindFolder(EnvironmentManager.Instance.MasterSite.ServerId);
	MIPOptionProperties prop = folder.GetMipOptionProperties(MyPluginId);
	textBoxGlobal.Text = "";
	textBoxGlobalXML.Text = prop.PropertiesXml;
}
 
private void buttonSetGlobalMIP_Click(object sender, EventArgs e)
{
	MIPKindFolder folder = new MIPKindFolder(EnvironmentManager.Instance.MasterSite.ServerId);
	MIPOptionProperties prop = folder.GetMipOptionProperties(MyPluginId);
	prop.PropertiesXml = textBoxGlobal.Text;
	prop.DataVersion++;
	folder.SetMipOptionProperties(prop);
}

and it read and write the option without any issue…

So the main question is still unanswered - what is the reason why I can’t Get/SaveOptionConfiguration ??

Can you please check if the user that you are using is in Administrator role?

Initially - no. By design, it should not be in the Administrator role.

Now I’ve added the admin role to the user for testing purposes. But this did not affect anything.

Hello,

The issue still not solved and I still need help…

Sorry for the delayed response.

Could you please check the MIP logs in [c:\ProgramData\Milestone\](file:c:/ProgramData/Milestone/)

If you are running in a Smart Client plugin you will need to first enable the logs. For SC 2020 R3 you can do that in the Settings dialog under Advanced tab (says “Logging (for technical support)”. After reproducing the error you can then find the log file here: [c:\ProgramData\Milestone\XProtect](file:c:/ProgramData/Milestone/XProtect) Smart Client\MIPLog.txt

I would expect some exception details to be logged there.

I faced the issue in my own standalone app. As I said in my first message there are no exceptions during SaveOptionsConfiguration. There is only the message in VS Output Window:

MIP: Error: LoginServerSvc.SetCustomSettingData ():Unable to update or save for id=

The exception will be catched and handled, but should also be logged, so if you are running in a standalone application please check [c:\ProgramData\Milestone\MIPSDK\MIP](file:c:/ProgramData/Milestone/MIPSDK/MIP).log

Yes, I found it.

On GetOptionsConfiguration:

2021-04-07 13:40:06.736 Error: GetConfiguration ():CustomSetting not found for the given platformDefinitionId: 233938c5-d582-4b96-85ed-288b8daa411d

It’s weird - in the fact the item exists. As I said previously I see the item using GetMipOptionProperties

On SaveOptionsConfiguration:

2021-04-07 13:41:24.449 Error: LoginServerSvc.SetCustomSettingData ():Unable to update or save for id=233938c5-d582-4b96-85ed-288b8daa411d

In short, nothing new, I described all this earlier…

I do agree that you have told this before, but I was hoping to find some further info in there.

Could you please let me know the version of MIP SDK and VMS you are using?

Server info: 20.3.a Name: XProtect Express+ 2020 R3

Where I can see the SDK version?

one option is to look in apps & features in Windows

Milestone MIP SDK 2020 R2

BTW, I’ve tried to call the same code from Management Client plugin and it works as expected - the expected XML read and saved without issues.

This took quite some investigation, but I might have an idea what could be the problem. Could you please use the config api client to check under MIP Kinds the kind that correspond to your ID and see what is set for “Define content type ITEM or OPTION”?

If it is set to ITEM you can try change it to OPTION and Save and then see if that solves your problem.

The content type is OPTION initially

What do you think is the reason why the Get/SaveOptionsConfiguration works well in the Administration environment but not works in Standalone and SmartClient environment? But at the same time the Get/SetMipOptionProperties works in any environment…

The implementations are a bit different, but we cannot figure out what is causing the difference you see. We also cannot reproduce unless we change the content type to ITEM, which is why I asked. Just to be sure: You are not storing any items from Management Client using the same GUID as the Kind?