The type initializer for ‘Microsoft.CodeAnalysis.StrongNameKeys’ threw an exception

  Uncategorised

Recently I’ve started receiving multiple warnings upon opening Visual Studio. I don’t understand what’s causing the issue and I can’t find any related information. Could anyone please help identify the issue? I’ve attached the stack trace log related to the warnings.

enter image description here
enter image description here

System.TypeInitializationException : The type initializer for 'Microsoft.CodeAnalysis.StrongNameKeys' threw an exception. ---> System.NullReferenceException : Object reference not set to an instance of an object.
   at Microsoft.CodeAnalysis.StrongNameKeys..cctor()
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   --- End of inner exception stack trace ---
   at Microsoft.CodeAnalysis.StrongNameKeys.Create(StrongNameProvider providerOpt,String keyFilePath,String keyContainerName,Boolean hasCounterSignature,CommonMessageProvider messageProvider)
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceAssemblySymbol.ComputeStrongNameKeys()
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceAssemblySymbol.get_StrongNameKeys()
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceAssemblySymbol.ComputeIdentity()
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceAssemblySymbol.get_Identity()
   at Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.AssemblySymbol.Microsoft.CodeAnalysis.IAssemblySymbol.get_Identity()
   at Microsoft.CodeAnalysis.CommonReferenceManager`2.ResolveMetadataReferences(TCompilation compilation,Dictionary`2 assemblyReferencesBySimpleName,ImmutableArray`1& references,IDictionary`2& boundReferenceDirectiveMap,ImmutableArray`1& boundReferenceDirectives,ImmutableArray`1& assemblies,ImmutableArray`1& modules,DiagnosticBag diagnostics)
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.ReferenceManager.CreateAndSetSourceAssemblyFullBind(CSharpCompilation compilation)
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.ReferenceManager.CreateSourceAssemblyForCompilation(CSharpCompilation compilation)
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.get_CommonAssembly()
   at Microsoft.CodeAnalysis.SolutionState.CompilationTracker.RecordAssemblySymbols(Compilation compilation,Dictionary`2 metadataReferenceToProjectId)
   at async Microsoft.CodeAnalysis.SolutionState.CompilationTracker.FinalizeCompilationAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.SolutionState.CompilationTracker.GetOrBuildCompilationInfoAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.SolutionState.CompilationTracker.GetCompilationSlowAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.SolutionState.CompilationTracker.GetMetadataReferenceAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.SolutionState.CompilationTracker.FinalizeCompilationAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.SolutionState.CompilationTracker.GetOrBuildCompilationInfoAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.SolutionState.CompilationTracker.GetCompilationSlowAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.SolutionState.CompilationTracker.GetMetadataReferenceAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.SolutionState.CompilationTracker.FinalizeCompilationAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.SolutionState.CompilationTracker.GetOrBuildCompilationInfoAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.SolutionState.CompilationTracker.GetCompilationSlowAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.Document.GetSemanticModelAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.GenerateFromMembers.AbstractGenerateFromMembersCodeRefactoringProvider.GetSelectedMemberInfoAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.AddConstructorParametersFromMembers.AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersFromMembersAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.AddConstructorParametersFromMembers.AddConstructorParametersFromMembersCodeRefactoringProvider.ComputeRefactoringsAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(<Unknown Parameters>)

Source: Visual Studio Questions

LEAVE A COMMENT