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

Options fail to deserialize #13556

Closed
davkean opened this issue Sep 2, 2016 · 11 comments
Closed

Options fail to deserialize #13556

davkean opened this issue Sep 2, 2016 · 11 comments

Comments

@davkean
Copy link
Member

davkean commented Sep 2, 2016

Hit this while debugging, I think it gets swallowed later so not sure of the impact:

The string is was trying to parse was "True", which isn't valid XML.

System.Xml.XmlException: 'Data at the root level is invalid. Line 1, position 1.'
    System.Xml.dll!System.Xml.XmlTextReaderImpl.Throw(System.Exception e)    Unknown
    System.Xml.dll!System.Xml.XmlTextReaderImpl.Throw(string res, string arg)    Unknown
    System.Xml.dll!System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()    Unknown
    System.Xml.dll!System.Xml.XmlTextReaderImpl.ParseDocumentContent()    Unknown
    System.Xml.dll!System.Xml.XmlTextReaderImpl.Read()    Unknown
    System.Xml.dll!System.Xml.XmlReader.MoveToContent()    Unknown
    System.Xml.Linq.dll!System.Xml.Linq.XElement.Load(System.Xml.XmlReader reader, System.Xml.Linq.LoadOptions options)    Unknown
    System.Xml.Linq.dll!System.Xml.Linq.XElement.Parse(string text, System.Xml.Linq.LoadOptions options)    Unknown
    System.Xml.Linq.dll!System.Xml.Linq.XElement.Parse(string text)    Unknown
>    Microsoft.VisualStudio.LanguageServices.CSharp.dll!Microsoft.VisualStudio.LanguageServices.CSharp.Options.AutomationObject.SetXmlOption(Microsoft.CodeAnalysis.Options.PerLanguageOption<Microsoft.CodeAnalysis.CodeStyle.CodeStyleOption<bool>> option, string value) Line 687    C#
    Microsoft.VisualStudio.LanguageServices.CSharp.dll!Microsoft.VisualStudio.LanguageServices.CSharp.Options.AutomationObject.Style_PreferIntrinsicPredefinedTypeKeywordInDeclaration.set(string value) Line 521    C
@balajikris
Copy link
Member

balajikris commented Sep 2, 2016

this is what @jasonmalinowski and @CyrusNajmabadi feared would be a breaking change with the work i did for Intrinsic type keyword/Framework type code style. see comments here #13132

I bet the scenario is reading values from an existing user settings file, where this was a boolean option, but is now a more complex string (with enforcements etc.). So, it won't parse well. The net effect i believe is that we lost your preference for this setting and chose the default instead, which would be that you prefer the intrinsic type keyword and enforcement level is None (so you won't be bothered if your code is not compliant). (Note that there was never a prefer framework type in VS2015).

This could be made better to whatever we prefer, by choosing a good default setting. But, if we cannot afford to lose the user setting at all, then we should provide some form of back compat to retain the existing setting.

@Pilchie
Copy link
Member

Pilchie commented Sep 6, 2016

I'm seeing that this is causing the keyword/framework option is never getting persisted, and ends up back at Framework type every time I restart VS :(

@balajikris
Copy link
Member

Spoke offline with @Pilchie . I'm unable to reproduce this behavior where the settings change fails to persist. If there is a consistent repro, please ping me.

Otherwise, for the issue reported originally in this bug, you'd encounter the setting didn't migrate over for the first time and it would start working after you set it the first time.

@Pilchie Pilchie modified the milestones: 2.0 (Preview 5), 2.0 (RC) Sep 26, 2016
@jasonmalinowski
Copy link
Member

Indeed, the assumption here is this is a migration issue, and won't be a problem going forward.

@jasonmalinowski
Copy link
Member

Ah, this is migration from previous VS versions. Grr.

@Pilchie
Copy link
Member

Pilchie commented Nov 2, 2016

Did we get to the bottom of this?

@davkean
Copy link
Member Author

davkean commented Nov 14, 2016

It was still occurring on my box when I left.

@Pilchie
Copy link
Member

Pilchie commented Nov 14, 2016

@davkean is back!

@davkean
Copy link
Member Author

davkean commented Nov 14, 2016

This was also occuring with side-by-side instances of VS as well, so where is this "bad" data coming from?

@Pilchie
Copy link
Member

Pilchie commented Dec 29, 2016

See #15705 - it looks like roaming settings can roam a value from VS 2017 back to VS 2015 and vice versa where we used the same key, but now store a different type.

@jmarolf
Copy link
Contributor

jmarolf commented Jan 11, 2017

fixed with #16373

@jmarolf jmarolf closed this as completed Jan 11, 2017
@jmarolf jmarolf removed their assignment Jan 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants