Problem
xamarin android designer suddenly displays an error message like this
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at Roslyn.Utilities.ObjectWriter.WriteKnownType(Type type) at Roslyn.Utilities.ObjectWriter.WriteObjectHeader(Object instance, UInt32 memberCount) at Roslyn.Utilities.ObjectWriter.WriteObjectInternal(IObjectWritable instance) at Xamarin.AndroidDesigner.Resources.Ast.ResourceRepositorySerializer.SerializeResourcesForJava(IEnumerable`1 resources, Int32 originalCount, Stream stream, IEnumerable`1 qualifiersToMatch) at Xamarin.AndroidDesigner.Resources.Ast.ResourceRepository.SerializeForJavaTo(Stream stream, IEnumerable`1 toMatch) at Xamarin.AndroidDesigner.Resources.Ast.ResourceProvisionator.SerializeRepositoryToFilePath(ResourceRepository repository, String path, IEnumerable`1 qualifiers) at Xamarin.AndroidDesigner.Resources.Ast.ResourceProvisionator.<>c__DisplayClass5_1.<CreateSerializationTasks>b__0() at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Xamarin.AndroidDesigner.Resources.Ast.ResourceProvisionator.<ProvisionResources>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Xamarin.AndroidDesigner.ResourceProvisionatorExtensions.<ProvisionResources>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Xamarin.AndroidDesigner.AndroidRenderSession.<InitSession>d__115.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
after that, all the layout show the same error message
What I've Do
- Repair Visual Studio