arshya jabbari
arshya jabbari

Reputation: 71

Visual Studio's features are unavailable due to internal error

Im currently having issues using the new version of Visual Studio 2022.Im trying to use .Net6 and C# to write some MVC code. The Warnings can be shown here

one of the main issues is that it doesnt show the syntax errors and suggestions anymore so its pretty annoying. the more detail is like this:

MessagePack.MessagePackSerializationException : Error writing JSON RPC Message: 

> MessagePackSerializationException: Failed to serialize
> Microsoft.CodeAnalysis.Remote.PinnedSolutionInfo value. --->
> MessagePack.MessagePackSerializationException : Failed to serialize
> Microsoft.CodeAnalysis.Remote.PinnedSolutionInfo value. --->
> System.TypeInitializationException : The type initializer for
> 'FormatterCache`1' threw an exception. --->
> System.BadImageFormatException : Could not load file or assembly
> 'System.Reflection.Emit.Lightweight, Version=4.0.0.0, Culture=neutral,
> PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The
> module was expected to contain an assembly manifest.    at
> MessagePack.Internal.DynamicObjectTypeBuilder.BuildFormatterToDynamicMethod(Type
> type,Boolean forceStringKey,Boolean contractless,Boolean allowPrivate)
> at
> MessagePack.Resolvers.DynamicObjectResolverAllowPrivate.FormatterCache`1..cctor()
> at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

any suggestions?

Upvotes: 7

Views: 10523

Answers (2)

Ahmed Fekry
Ahmed Fekry

Reputation: 104

try devenv.exe /ResetSettings and restart

C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe /ResetSettings

Upvotes: 0

metoyou
metoyou

Reputation: 679

I had a similar issue and going to the Visual Studio Installer and then choosing repair fixed the issue for me.

Upvotes: 3

Related Questions