Bug 51488 - Unhandled Activation Error
Summary: Unhandled Activation Error
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Activation ()
Version: 4.3.0 (C9)
Hardware: PC Windows
: High critical
Target Milestone: 4.3.0 (C9)
Assignee: Jose Gallardo
: 51234 51560 51603 ()
Depends on:
Reported: 2017-01-12 16:10 UTC by David Ortinau [MSFT]
Modified: 2018-10-30 10:22 UTC (History)
11 users (show)

Tags: BZRC9B1_C8SR2S1
Is this bug a regression?: Yes
Last known good build: C9 XVS

unhandled activation error (26.47 KB, image/png)
2017-01-12 16:10 UTC, David Ortinau [MSFT]
vs 2015 environment (2.16 KB, text/plain)
2017-01-12 16:25 UTC, David Ortinau [MSFT]
vs xamarin logs (2.44 KB, application/x-zip-compressed)
2017-01-12 17:16 UTC, David Ortinau [MSFT]
IDE logs (from additional local confirmation) (1.24 KB, application/zip)
2017-01-12 19:43 UTC, Brendan Zagaeski (Xamarin Team, assistant)

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description David Ortinau [MSFT] 2017-01-12 16:10:04 UTC
Created attachment 19306 [details]
unhandled activation error

Getting this error on first run, build of a Xamarin.Forms project after updating to the Beta channel.

Couple things I've done recently in testing new builds that could be related.
- I uninstalled VS 2017 RC
- I repaired VS 2015 Community
- I was still missing Xamarin bits, so I modified VS 2015 to reinstall the Xamarin bits

Then I was able to start a new Xamarin Forms project. 

I can login with my account on the same Windows machine via the browser. 

I get the same error when using the Tools > Xamarin Account... option to login.

The build fails because it is looking for a license and cannot find it.
Comment 1 David Ortinau [MSFT] 2017-01-12 16:25:21 UTC
Created attachment 19307 [details]
vs 2015 environment

Here's my environment dump from the About modal.
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2017-01-12 16:55:30 UTC
## Non-engineering team preliminary review

Depending on the "flavor" of this bug from your side (for example, whether you're just looking to get up and running or whether you're interested to help study the bug a bit), there are a couple possible directions you could try for additional preliminary data gathering:

1. If you get a chance, please collect and attach back the IDE logs files from "Help > Xamarin > Zip Xamarin Logs".  Since that command zips the logs from only the current VS session, be sure to run that log gathering step after hitting the activation error once more (in the same VS session).

2. If you're looking to get back up and running as quickly as possible, does downgrading [1] back to XamarinVS 4.2.2 (Cycle 8 Service Release 2) resolve the issue?

[1] https://kb.xamarin.com/customer/portal/articles/1699777-downgrading

Thanks in advance!
Comment 3 David Ortinau [MSFT] 2017-01-12 17:16:04 UTC
Created attachment 19309 [details]
vs xamarin logs

Logs attached
Comment 4 Brendan Zagaeski (Xamarin Team, assistant) 2017-01-12 18:37:54 UTC
Interesting.  It appears the key excerpt from the log file is:

> Xamarin.VisualStudio.ActivationManager|Error|0|Failed to update iOS license.
> System.Exception: Could not load machine data ---> System.ComponentModel.Win32Exception: The system cannot find the file specified
>    at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
>    at System.Diagnostics.Process.Start()
>    at Xamarin.Components.Ide.Licensing.ActivationMachineData.<>c__DisplayClass3_0.<GetRegistrationXmlAsync>b__0()
>    at System.Threading.Tasks.Task`1.InnerInvoke()
>    at System.Threading.Tasks.Task.Execute()
> --- End of stack trace from previous location where exception was thrown ---

If I recall correctly, it might be incorrect for the `System.Diagnostics.Process.Start()` method to be called at all in this code path on Windows.  If that method is always getting called on Windows when the user tries to log in with an an old-style Xamarin standalone license, then I believe this should in theory be easy to replicate on any system.  I will temporarily assign the bug to myself to take a quick try at replicating the issue locally.
Comment 5 Brendan Zagaeski (Xamarin Team, assistant) 2017-01-12 19:43:01 UTC
Created attachment 19316 [details]
IDE logs (from additional local confirmation)

It looks like Comment 4 is approximately correct.  I suspect the current Beta build of XamarinVS might be somehow using a library that was compiled with a missing compile-time define and so doesn't have the expected Windows-specific behavior.

## Regressions status: regression between Cycle 8 Service Release 2 and Cycle 9 Beta

GOOD: XamarinVS   (27a9b40) "Cycle 8 Service Release 2"
BAD:  XamarinVS (ff5ef6d) "Cycle 9 Beta 1"

## Steps tested

1. Navigate to "Tools > Xamarin Account".

2. Click the "Log In" button and complete the worfklow to log in with an old-style standalone Xamarin account.

## GOOD Results (XamarinVS (27a9b40) "Cycle 8 Service Release 2")

The login completes without error, and the dialog shows the old-style standalone Xamarin license entitlements.

## BAD Results (XamarinVS (ff5ef6d) "Cycle 9 Beta 1")

The login fails with the dialog as described in Comment 0:

> Unhandled Activation Error
> Could not load machine data
And my log files (attached) show the same error from Comment 4.

## Additional test environment info (brief)

Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Windows 10 (64-bit) Version 1607 (OS Build 14393.693)
Comment 6 Juan Marcelo Tondato 2017-01-16 18:42:13 UTC
*** Bug 51560 has been marked as a duplicate of this bug. ***
Comment 7 Rajneesh Kumar 2017-01-16 19:04:48 UTC
*** Bug 51234 has been marked as a duplicate of this bug. ***
Comment 8 Mohit Kheterpal 2017-01-16 19:23:44 UTC
An update for Regression Status of this issue :

Regression Status : REGRESSION : Working fine with C9 XVS
Comment 9 Jose Gallardo 2017-01-16 21:14:49 UTC
This bug is already in progress.
Comment 11 xamarin-release-manager 2017-01-17 21:27:39 UTC
Fixed in version (master)

Author: Emanuel
Commit: e553ae80032cbf9d33aa945ffc2df9b4d0b8a688 (xamarin/XamarinVS)
Comment 12 xamarin-release-manager 2017-01-17 21:28:08 UTC
Fixed in version (cycle9)

Author: Emanuel
Commit: af46929e7d87f4d2fbdc5a18ab778a34715d5296 (xamarin/XamarinVS)
Comment 14 Jose Gallardo 2017-01-18 18:48:33 UTC
*** Bug 51603 has been marked as a duplicate of this bug. ***