|
-
Jul 12th, 2008, 12:34 AM
#1
App Settings Problem
Hi guys, in one of my applications (Screen Shot) that I posted in the UtilityBank some users complain that after installing the application it gives an error. I should note that it happens with system that has windows with German version installed. Here is the error message translated from German:
The FullScreenModeHK-Property couldn't be created from its default value. Error message: No such requested value Ctrl."
The “FullScreenModeHK” app setting’s property is a type of System.Windows.Forms.Keys and it is for holding an application hotkey. Here is the entire error text:
Code:
Screen Shot Error Report
Date: 30.06.2008 09:54:53
Type:
System.ArgumentException
Message:
Die FullScreenModeHK-Eigenschaft konnte nicht aus ihrem Standardwert erstellt werden. Fehlermeldung: Der angeforderte Wert Ctrl konnte nicht gefunden werden.
Source:
System
Stack Trace:
bei System.Configuration.SettingsPropertyValue.Deserialize()
bei System.Configuration.SettingsPropertyValue.get_PropertyValue()
bei System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName)
bei System.Configuration.SettingsBase.get_Item(String propertyName)
bei System.Configuration.ApplicationSettingsBase.GetPropertyValue(String propertyName)
bei System.Configuration.ApplicationSettingsBase.get_Item(String propertyName)
bei Screen_Shot.MenuForm.SetHotkeys()
bei Screen_Shot.MenuForm.Form1_Load(Object sender, EventArgs e)
bei System.EventHandler.Invoke(Object sender, EventArgs e)
bei System.Windows.Forms.Form.OnLoad(EventArgs e)
bei System.Windows.Forms.Form.OnCreateControl()
bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
bei System.Windows.Forms.Control.CreateControl()
bei System.Windows.Forms.Control.WmShowWindow(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.ContainerControl.WndProc(Message& m)
bei System.Windows.Forms.Form.WmShowWindow(Message& m)
bei System.Windows.Forms.Form.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
It is obvious that the application or system fails to deserialize the key, but I can’t find out why and what should I do. The System.Windows.Forms.Keys type is selectable for the app settings property type but it fails to deserialize for windows with German versions.
Now, one way to fix this is to change the data type to integer and convert it back to keys type but is there a better way to fix this problem leaving the type as System.Windows.Forms.Keys?
Thanks in advance.
Last edited by VBDT; Jul 12th, 2008 at 02:13 AM.
-
Jul 12th, 2008, 12:47 AM
#2
Re: App Settings Problem
Is it possible that the initial value is blank, instead of the default Keys.None value?
-
Jul 12th, 2008, 01:02 AM
#3
Re: App Settings Problem
No Jmcilhinney, the initial value for that property is “Ctrl+F”. This value is also in the app.config as the application initial settings value before creating Settings file for the user. The app is fine with English version. This got to do something with German language. I don’t know the user’s computer have English installed on it at all but I think it should be since it should be the default language.
This is what it looks like in the app.config file.
Code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="WindowsApplication1.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
<userSettings>
<WindowsApplication1.My.MySettings>
<setting name="HotKey" serializeAs="String">
<value>Ctrl+F</value>
</setting> </WindowsApplication1.My.MySettings>
</userSettings></configuration>
-
Jul 12th, 2008, 01:33 AM
#4
Re: App Settings Problem
I would suggest that you get one of these German users to create a project with a setting of type Keys with the same value, then open their app.config file to see what it contains. If it's the same value then they should run their app and see if they get the same error. If they do then it's for them to report that bug to Microsoft. If they don't get the same error or their config file is different, then I'd suggest that you report it to Microsoft.
-
Jul 13th, 2008, 05:41 PM
#5
Re: App Settings Problem
 Originally Posted by jmcilhinney
I would suggest that you get one of these German users to create a project with a setting of type Keys with the same value, then open their app.config file to see what it contains. If it's the same value then they should run their app and see if they get the same error. If they do then it's for them to report that bug to Microsoft. If they don't get the same error or their config file is different, then I'd suggest that you report it to Microsoft.
Thanks Jmc, I will see if I can make the German users do some tests for me. I may post this problem on MS forums too, I’ll see if I can get any feedback.
Thanks again,
VBDT
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|