Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] XmlException invalid character in config #199

Closed
Hofknecht opened this issue Oct 1, 2021 · 0 comments
Closed

[BUG] XmlException invalid character in config #199

Hofknecht opened this issue Oct 1, 2021 · 0 comments
Assignees
Labels
Milestone

Comments

@Hofknecht
Copy link
Owner

Hello Tom,

Thank you for reporting the bug

System.Xml.XmlException: '.', hexadecimal value 0x00, is an invalid character. Line 1, position 1. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args) at System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Char[] data, Int32 length, Int32 invCharPos) at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options) at SystemTrayMenu.Properties.CustomSettingsProvider.LoadValuesFromFile() in D:\a\1\s\Properties\CustomSettingsProvider.cs:line 176 at SystemTrayMenu.Properties.CustomSettingsProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection collection) in D:\a\1\s\Properties\CustomSettingsProvider.cs:line 88 at System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider) at System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName) at System.Configuration.SettingsBase.get_Item(String propertyName) at System.Configuration.ApplicationSettingsBase.GetPropertyValue(String propertyName) at System.Configuration.ApplicationSettingsBase.get_Item(String propertyName) at SystemTrayMenu.Properties.Settings.get_CurrentCultureInfoName() in D:\a\1\s\Properties\Settings.Designer.cs:line 38 at SystemTrayMenu.Utilities.Translator.Initialize() in D:\a\1\s\Utilities\Translator.cs:line 18 at SystemTrayMenu.Program.Main() in D:\a\1\s\Business\Program.cs:line 25

=> Solution maybe to try catch the load and if it failes to recreate the config file

but still no idea how Tom brought in this hex character into config CurrentCultureInfoName which is e.g. "en".
i can only reproduce during debugger replace in set CurrentCultureInfoName the value with "en\0x00"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant