Results 1 to 5 of 5

Thread: App Settings Problem

  1. #1

    Thread Starter
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,922

    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.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: App Settings Problem

    Is it possible that the initial value is blank, instead of the default Keys.None value?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,922

    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>

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,922

    Re: App Settings Problem

    Quote 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
  •  



Click Here to Expand Forum to Full Width