System.UnauthorizedAccessException error with Visual Studio and Xamarin

When you try and install Mono.Android in Visual Studio for the first time you may find that you're presented with an error similar to the one below:

System.UnauthorizedAccessException: Access to the path 'C:\ProgramData\Mono for Android\License' is denied.
at Xamarin.Components.Ide.Activation.ActivationService.GetErrorWorkflow(LicenseSyncResult[] results, Boolean ignoreSyncErrors)
at Xamarin.Components.Ide.Activation.ActivationService.<GenerateFullWorkflowSequence>d__88.MoveNext()
at Xamarin.Components.Ide.Activation.ActivationDialog.DisplayWorkflowStep(ActivationWorkflowStep step)
at Xamarin.Components.Ide.Activation.ActivationDialog.<>c__DisplayClass13.<StartSpinnerTaskAndScheduleContinuation>b__12(Task t)

If you close down VS and run it again as an Administrator it should sort the issue out.

Remember activation of your Xamarin licenses doesn't actually kick off until you run the project for the first time.

If you're still having activation issues then remove the license files first:

Run Visual Studio as Administrator, run your Android or iOS project and it should ask you to login to your Xamarin account.  Once logged in it should sort out the licensing issues.


Popular posts from this blog

Switching Xamarin Accounts on Mac and Windows

Xamarin Forms - InitializeComponent does not exist in the current context

How to setup Azure Service Bus Relay to use with ACS