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

is error on visual studio 2022 17.10.0 preview 3 #1438

Closed
mzy666888 opened this issue Apr 12, 2024 · 8 comments
Closed

is error on visual studio 2022 17.10.0 preview 3 #1438

mzy666888 opened this issue Apr 12, 2024 · 8 comments

Comments

@mzy666888
Copy link

Product and Version Used:
visual studio 2022 17.10.0 preview 3
roslynator 4.12.0

Steps to Reproduce:

Actual Behavior:
open every project open error
image

disable it (roslynator) don't show this error

Expected Behavior:

@josefpihrt
Copy link
Collaborator

Hi,

Could you switch VS language to english so I can see what's in the message? Or could you write here what's in the message?

@KuhnMa-TLS
Copy link

image

@KuhnMa-TLS
Copy link

Stacktrace for 'Asset synchronization':
System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation. ---> System.Collections.Generic.KeyNotFoundException : The given key 'Layer' was not present in the dictionary.
at System.Collections.Immutable.ImmutableDictionary2.get_Item(TKey key) at Microsoft.CodeAnalysis.Host.Mef.LanguageServiceMetadata..ctor(IDictionary2 data)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target,Object[] arguments,Signature sig,Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr,Binder binder,Object[] parameters,CultureInfo culture)
at Microsoft.VisualStudio.Composition.MetadataViewClassProvider.CreateProxy(IReadOnlyDictionary2 metadata,IReadOnlyDictionary2 defaultValues,Type metadataViewType)
at Microsoft.VisualStudio.Composition.ExportProvider.g__CreateLazy|81_0[T,TMetadataView](Export export,IMetadataViewProvider metadataViewProvider)
at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
at Microsoft.CodeAnalysis.Host.Mef.VisualStudioMefHostServices.b__5_0[TExtension,TMetadata](ExportKey _)
at System.Collections.Immutable.ImmutableInterlocked.GetOrAdd[TKey,TValue](ImmutableDictionary2& location,TKey key,Func2 valueFactory)
at Microsoft.CodeAnalysis.Host.Mef.VisualStudioMefHostServices.GetExportsTExtension,TMetadata
at Microsoft.CodeAnalysis.Host.Mef.MefWorkspaceServices.GetSupportedLanguages()
at Microsoft.CodeAnalysis.Serialization.SerializerService..ctor(SolutionServices workspaceServices)
at Microsoft.CodeAnalysis.Serialization.SerializerService.Factory.CreateService(HostWorkspaceServices workspaceServices)
at System.Lazy1.CreateValue() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Lazy1.get_Value()
at Microsoft.CodeAnalysis.Host.Mef.MefWorkspaceServices.GetServiceTWorkspaceService
at Microsoft.CodeAnalysis.Host.HostWorkspaceServices.GetRequiredServiceTWorkspaceService
at async Microsoft.CodeAnalysis.SolutionState.ComputeChecksumsAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.SolutionState.GetChecksumAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.SolutionCompilationState.ComputeChecksumsAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.SolutionCompilationState.<>c.<-ctor>b__18_0()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.SolutionCompilationState.GetChecksumAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Remote.SolutionAssetStorage.StoreAssetsAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.TryInvokeAsyncTService

@KuhnMa-TLS
Copy link

Stacktrace for 'DesignerAttribute discovery':
System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation. ---> System.Collections.Generic.KeyNotFoundException : The given key 'Layer' was not present in the dictionary.
at System.Collections.Immutable.ImmutableDictionary2.get_Item(TKey key) at Microsoft.CodeAnalysis.Host.Mef.LanguageServiceMetadata..ctor(IDictionary2 data)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target,Object[] arguments,Signature sig,Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr,Binder binder,Object[] parameters,CultureInfo culture)
at Microsoft.VisualStudio.Composition.MetadataViewClassProvider.CreateProxy(IReadOnlyDictionary2 metadata,IReadOnlyDictionary2 defaultValues,Type metadataViewType)
at Microsoft.VisualStudio.Composition.ExportProvider.g__CreateLazy|81_0[T,TMetadataView](Export export,IMetadataViewProvider metadataViewProvider)
at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
at Microsoft.CodeAnalysis.Host.Mef.VisualStudioMefHostServices.b__5_0[TExtension,TMetadata](ExportKey _)
at System.Collections.Immutable.ImmutableInterlocked.GetOrAdd[TKey,TValue](ImmutableDictionary2& location,TKey key,Func2 valueFactory)
at Microsoft.CodeAnalysis.Host.Mef.VisualStudioMefHostServices.GetExportsTExtension,TMetadata
at Microsoft.CodeAnalysis.Host.Mef.MefWorkspaceServices.GetSupportedLanguages()
at Microsoft.CodeAnalysis.Serialization.SerializerService..ctor(SolutionServices workspaceServices)
at Microsoft.CodeAnalysis.Serialization.SerializerService.Factory.CreateService(HostWorkspaceServices workspaceServices)
at System.Lazy1.CreateValue() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Lazy1.get_Value()
at Microsoft.CodeAnalysis.Host.Mef.MefWorkspaceServices.GetServiceTWorkspaceService
at Microsoft.CodeAnalysis.Host.HostWorkspaceServices.GetRequiredServiceTWorkspaceService
at async Microsoft.CodeAnalysis.SolutionState.ComputeChecksumsAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.SolutionState.GetChecksumAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.SolutionCompilationState.ComputeChecksumsAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.SolutionCompilationState.<>c.<-ctor>b__18_0()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.SolutionCompilationState.GetChecksumAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Remote.SolutionAssetStorage.StoreAssetsAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.TryInvokeAsyncTService

@josefpihrt
Copy link
Collaborator

@KuhnMa-TLS Thanks!

@josefpihrt
Copy link
Collaborator

josefpihrt commented Apr 12, 2024

I think this issue is a duplicate of #1437

@josefpihrt josefpihrt closed this as not planned Won't fix, can't repro, duplicate, stale Apr 12, 2024
@mzy666888
Copy link
Author

image

log file

=====================
2024-04-13 15:01:04
LimitedFunctionality
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.VisualStudio.Composition.MetadataViewClassProvider.CreateProxy(IReadOnlyDictionary2 metadata, IReadOnlyDictionary2 defaultValues, Type metadataViewType)
at Microsoft.VisualStudio.Composition.ExportProvider.g__CreateLazy|81_0[T,TMetadataView](Export export, IMetadataViewProvider metadataViewProvider)
at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
at Microsoft.CodeAnalysis.Host.Mef.VisualStudioMefHostServices.b__5_0[TExtension,TMetadata](ExportKey _)
at System.Collections.Immutable.ImmutableInterlocked.GetOrAdd[TKey,TValue](ImmutableDictionary2& location, TKey key, Func2 valueFactory)
at Microsoft.CodeAnalysis.Host.Mef.VisualStudioMefHostServices.GetExportsTExtension,TMetadata
at Microsoft.CodeAnalysis.Host.Mef.MefLanguageServices..ctor(MefWorkspaceServices workspaceServices, String language)
at Microsoft.CodeAnalysis.Host.Mef.MefWorkspaceServices.<>c.b__21_0(String languageName, MefWorkspaceServices self)
at System.Collections.Immutable.ImmutableInterlocked.GetOrAdd[TKey,TValue,TArg](ImmutableDictionary2& location, TKey key, Func3 valueFactory, TArg factoryArgument)
at Microsoft.CodeAnalysis.Host.Mef.MefWorkspaceServices.GetLanguageServices(String languageName)
at Microsoft.CodeAnalysis.SolutionState.AddProject(ProjectInfo projectInfo)
at Microsoft.CodeAnalysis.SolutionCompilationState.AddProject(ProjectInfo projectInfo)
at Microsoft.CodeAnalysis.Solution.AddProject(ProjectInfo projectInfo)
at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProjectFactory.<>c__DisplayClass35_1.b__1(Solution oldSolution)
at Microsoft.CodeAnalysis.Workspace.<>c.b__27_3(Solution oldSolution, ValueTuple5 data) at Microsoft.CodeAnalysis.Workspace.<SetCurrentSolutionAsync>d__291.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.Workspace.d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask1.get_Result() at Roslyn.Utilities.ValueTaskExtensions.VerifyCompleted[T](ValueTask1 task, String message)
at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProjectFactory.<>c__DisplayClass35_0.b__0(Workspace w)
at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProjectFactory.d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProjectFactory.d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProjectFactory.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.CPS.CPSProjectFactory.d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.LanguageServices.Workspace.<>c__DisplayClass40_0.<g__ProcessInitialEvaluationDataAsync|1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.g__Action|0()
at GuardMethodClass.GuardMethod(Func1 , Func2 , Func2 ) ---> System.Collections.Generic.KeyNotFoundException: The given key 'Layer' was not present in the dictionary. at System.Collections.Immutable.ImmutableDictionary2.get_Item(TKey key)
at Microsoft.CodeAnalysis.Host.Mef.LanguageServiceMetadata..ctor(IDictionary`2 data)
--- End of inner exception stack trace ---

2024-04-13 15:01:07
LimitedFunctionality
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.VisualStudio.Composition.MetadataViewClassProvider.CreateProxy(IReadOnlyDictionary2 metadata, IReadOnlyDictionary2 defaultValues, Type metadataViewType)
at Microsoft.VisualStudio.Composition.ExportProvider.g__CreateLazy|81_0[T,TMetadataView](Export export, IMetadataViewProvider metadataViewProvider)
at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
at Microsoft.CodeAnalysis.Host.Mef.VisualStudioMefHostServices.b__5_0[TExtension,TMetadata](ExportKey _)
at System.Collections.Immutable.ImmutableInterlocked.GetOrAdd[TKey,TValue](ImmutableDictionary2& location, TKey key, Func2 valueFactory)
at Microsoft.CodeAnalysis.Host.Mef.VisualStudioMefHostServices.GetExportsTExtension,TMetadata
at Microsoft.CodeAnalysis.Host.Mef.MefLanguageServices..ctor(MefWorkspaceServices workspaceServices, String language)
at Microsoft.CodeAnalysis.Host.Mef.MefWorkspaceServices.<>c.b__21_0(String languageName, MefWorkspaceServices self)
at System.Collections.Immutable.ImmutableInterlocked.GetOrAdd[TKey,TValue,TArg](ImmutableDictionary2& location, TKey key, Func3 valueFactory, TArg factoryArgument)
at Microsoft.CodeAnalysis.Host.Mef.MefWorkspaceServices.GetLanguageServices(String languageName)
at Microsoft.CodeAnalysis.SolutionState.AddProject(ProjectInfo projectInfo)
at Microsoft.CodeAnalysis.SolutionCompilationState.AddProject(ProjectInfo projectInfo)
at Microsoft.CodeAnalysis.Solution.AddProject(ProjectInfo projectInfo)
at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProjectFactory.<>c__DisplayClass35_1.b__1(Solution oldSolution)
at Microsoft.CodeAnalysis.Workspace.<>c.b__27_3(Solution oldSolution, ValueTuple5 data) at Microsoft.CodeAnalysis.Workspace.<SetCurrentSolutionAsync>d__291.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.Workspace.d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask1.get_Result() at Roslyn.Utilities.ValueTaskExtensions.VerifyCompleted[T](ValueTask1 task, String message)
at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProjectFactory.<>c__DisplayClass35_0.b__0(Workspace w)
at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProjectFactory.d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.Workspaces.ProjectSystem.ProjectSystemProjectFactory.d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProjectFactory.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.CPS.CPSProjectFactory.d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.LanguageServices.Workspace.<>c__DisplayClass40_0.<g__ProcessInitialEvaluationDataAsync|1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.g__Action|0()
at GuardMethodClass.GuardMethod(Func1 , Func2 , Func2 ) ---> System.Collections.Generic.KeyNotFoundException: The given key 'Layer' was not present in the dictionary. at System.Collections.Immutable.ImmutableDictionary2.get_Item(TKey key)
at Microsoft.CodeAnalysis.Host.Mef.LanguageServiceMetadata..ctor(IDictionary`2 data)
--- End of inner exception stack trace ---

@josefpihrt josefpihrt added the Bug label Apr 16, 2024
@bonyjose
Copy link

latest release fixed the issue.

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

4 participants