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

Can't persist some options. #16412

Closed
CyrusNajmabadi opened this issue Jan 11, 2017 · 1 comment
Closed

Can't persist some options. #16412

CyrusNajmabadi opened this issue Jan 11, 2017 · 1 comment
Labels
Area-External Area-IDE Bug Resolution-External The behavior lies outside the functionality covered by this repository

Comments

@CyrusNajmabadi
Copy link
Member

When i try to persist some options (like SymbolSearchOptions.SuggestForTypesInNuGetPackages) i get the following exception:

System.InvalidCastException: Unable to cast object of type 'System.Boolean' to type 'System.Collections.Generic.List`1[System.Collections.Generic.KeyValuePair`2[System.String,System.Object]]'.
   at Microsoft.VisualStudio.Settings.Internal.Serializer.CastWithUnboxing[T](Object value)

With this stack:

Microsoft.VisualStudio.Utilities.dll!Microsoft.VisualStudio.Settings.Internal.Serializer.CastWithUnboxing<System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<string, object>>>(object value) Line 347	C#
 	Microsoft.VisualStudio.Utilities.dll!Microsoft.VisualStudio.Settings.Internal.Serializer.Deserialize<System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<string, object>>>(string s, bool shouldLogTypeConversionErrors, out System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<string, object>> result) Line 279	C#
>	Microsoft.VisualStudio.Utilities.dll!Microsoft.VisualStudio.Settings.SettingsManager.TryDeserialize<System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<string, object>>>(string data, bool shouldLogTypeConversionErrors, out System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<string, object>> result) Line 328	C#
 	Microsoft.VisualStudio.Utilities.dll!Microsoft.VisualStudio.Settings.SettingsManager..ctor.AnonymousMethod__21_0(string data) Line 156	C#
 	Microsoft.VisualStudio.Utilities.dll!Microsoft.VisualStudio.Settings.UploaderDownloader.IsList(string serialized) Line 314	C#
 	Microsoft.VisualStudio.Utilities.dll!Microsoft.VisualStudio.Settings.UploaderDownloader.UpdateSharedStoreFromPrivateStoreAsync(string name, Microsoft.VisualStudio.Settings.IAsyncStringStorage sharedStore) Line 81	C#
 	Microsoft.VisualStudio.Utilities.dll!Microsoft.VisualStudio.Settings.SettingsManager.UpdateSharedStoreFromPrivateStore(string name) Line 691	C#
 	Microsoft.VisualStudio.Utilities.dll!Microsoft.VisualStudio.Settings.SettingsManager.UploadToSharedStoreIfShared(string settingName) Line 610	C#
 	Microsoft.VisualStudio.Utilities.dll!Microsoft.VisualStudio.Settings.SettingsManager.OnPropertyChangedAsync(object sender, System.ComponentModel.PropertyChangedEventArgs args) Line 595	C#
 	[Native to Managed Transition]	
 	[Managed to Native Transition]	
 	mscorlib.dll!System.Delegate.DynamicInvokeImpl(object[] args)	Unknown
 	Microsoft.VisualStudio.Utilities.dll!Microsoft.VisualStudio.PlatformUI.ExtensionMethods.RaiseEventAsync<System.ComponentModel.PropertyChangedEventArgs>(System.Delegate eventHandler, object source, System.ComponentModel.PropertyChangedEventArgs args) Line 815	C#
 	Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.Services.Settings.DelegatingStringStorage.OnPropertyChangedAsync(object sender, System.ComponentModel.PropertyChangedEventArgs args)	Unknown
 	[Native to Managed Transition]	
 	[Managed to Native Transition]	
 	mscorlib.dll!System.Delegate.DynamicInvokeImpl(object[] args)	Unknown
 	Microsoft.VisualStudio.Utilities.dll!Microsoft.VisualStudio.PlatformUI.ExtensionMethods.RaiseEventAsync<System.ComponentModel.PropertyChangedEventArgs>(System.Delegate eventHandler, object source, System.ComponentModel.PropertyChangedEventArgs args) Line 815	C#
 	Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.Services.Settings.RegistryStringStorage.RaiseChangeEventAsync(string name)	Unknown
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start<Microsoft.VisualStudio.Services.Settings.RegistryStringStorage.<RaiseChangeEventAsync>d__2>(ref Microsoft.VisualStudio.Services.Settings.RegistryStringStorage.<RaiseChangeEventAsync>d__2 stateMachine)	Unknown
 	Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.Services.Settings.RegistryStringStorage.RaiseChangeEventAsync(string name)	Unknown
 	Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.Services.Settings.RegistryStringStorage.SetAsync(string name, Microsoft.VisualStudio.Settings.StringWithMachineLocalFlag value)	Unknown
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start<Microsoft.VisualStudio.Services.Settings.RegistryStringStorage.<SetAsync>d__6>(ref Microsoft.VisualStudio.Services.Settings.RegistryStringStorage.<SetAsync>d__6 stateMachine)	Unknown
 	Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.Services.Settings.RegistryStringStorage.SetAsync(string name, Microsoft.VisualStudio.Settings.StringWithMachineLocalFlag value)	Unknown
 	Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.Services.Settings.DelegatingStringStorage.SetAsync(string name, Microsoft.VisualStudio.Settings.StringWithMachineLocalFlag value)	Unknown
 	mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start<Microsoft.VisualStudio.Services.Settings.DelegatingStringStorage.<SetAsync>d__9>(ref Microsoft.VisualStudio.Services.Settings.DelegatingStringStorage.<SetAsync>d__9 stateMachine)	Unknown
 	Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.Services.Settings.DelegatingStringStorage.SetAsync(string name, Microsoft.VisualStudio.Settings.StringWithMachineLocalFlag value)	Unknown
 	Microsoft.VisualStudio.Utilities.dll!Microsoft.VisualStudio.Settings.SettingsManager.SetValueInternalAsync(string name, object value, bool isMachineLocal) Line 509	C#
 	Microsoft.VisualStudio.Utilities.dll!Microsoft.VisualStudio.Settings.SettingsManager.SetValueAsync(string name, object value, bool isMachineLocal) Line 847	C#
 	Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.Services.Settings.VsSettingsManager.Microsoft.VisualStudio.Settings.ISettingsManager.SetValueAsync(string name, object value, bool isMachineLocal)	Unknown
 	Microsoft.VisualStudio.LanguageServices.dll!Microsoft.VisualStudio.LanguageServices.Implementation.Options.RoamingVisualStudioProfileOptionPersister.TryPersist(Microsoft.CodeAnalysis.Options.OptionKey optionKey, object value) Line 249	C#
 	Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.Options.GlobalOptionService.SetOptions(Microsoft.CodeAnalysis.Options.OptionSet optionSet) Line 127	C#
 	Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.Options.OptionServiceFactory.OptionService.SetOptions(Microsoft.CodeAnalysis.Options.OptionSet optionSet) Line 126	C#
 	Microsoft.VisualStudio.LanguageServices.Implementation.dll!Microsoft.VisualStudio.LanguageServices.Implementation.Options.PerLanguageOptionBinding<bool>.Value.set(bool value) Line 32	C#
@Pilchie
Copy link
Member

Pilchie commented Jan 20, 2017

I believe that @jmarolf found that this was a red-herring, and the actual issue was with the settings host process missing a binding redirect, which has now been fixed.

@Pilchie Pilchie closed this as completed Jan 20, 2017
@Pilchie Pilchie added Area-External Resolution-External The behavior lies outside the functionality covered by this repository labels Jan 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-External Area-IDE Bug Resolution-External The behavior lies outside the functionality covered by this repository
Projects
None yet
Development

No branches or pull requests

3 participants