Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does this unrelated error happen when I try to setup Windows 8 settings?

I have a few lines of code that have worked fine for months, and now suddenly they do not work and I get a very strange error. Here is the function in question:

public void OnCommandsRequested(SettingsPane settingsPane, SettingsPaneCommandsRequestedEventArgs eventArgs) {
        UICommandInvokedHandler handler = new UICommandInvokedHandler(OnSettingsCommand);
        SettingsCommand appSettings = new SettingsCommand("appSettings", "アプリ内設定", handler);
        eventArgs.Request.ApplicationCommands.Add(appSettings);
}

Naturally, this gets called in response to the SettingsPane.GetForCurrentView().CommandsRequested event. The error happens on the second line and is as follows:

A first chance exception of type 'System.FormatException' occurred in mscorlib.dll

Additional information: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

If I continue the app, then another exception comes:

A first chance exception of type 'System.InvalidCastException' occurred in mscorlib.dll

Additional information: Object in an IPropertyValue is of type 'String', which cannot be converted to a 'Guid'.

What is going on here? As you can see I'm not using any GUID values anywhere.

like image 765
borrrden Avatar asked Oct 02 '22 04:10

borrrden


1 Answers

Although the documentation lists no restrictions, and all samples use strings, the first parameter is listed as taking Object - it's possible this now is simply set to require a giud.

Interestingly, it looks like this has been reported to Microsoft as a bug in the OS. No idea what the resolution is going to be.

like image 183
Clockwork-Muse Avatar answered Oct 06 '22 00:10

Clockwork-Muse