Bug 38566 - Upstream VS complication: downgrade Xamarin, set system clock back, upgrade Xamarin causes "package did not load correctly" due to future timestamp in ConfigPkgDefCacheTimestamp VS registry key
Summary: Upstream VS complication: downgrade Xamarin, set system clock back, upgrade X...
Status: RESOLVED UPSTREAM
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Installer ()
Version: 4.0.0 (C6)
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-02-09 09:15 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2016-05-11 13:42 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Example Activity Log (19.47 KB, application/zip)
2016-02-09 09:15 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details


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:
Status:
RESOLVED UPSTREAM

Description Brendan Zagaeski (Xamarin Team, assistant) 2016-02-09 09:15:29 UTC
Created attachment 14955 [details]
Example Activity Log

Upstream VS complication: downgrade Xamarin, set system clock back, upgrade Xamarin causes "package did not load correctly" due to future timestamp in ConfigPkgDefCacheTimestamp VS registry key




Regression status: not a regression.




## Fix

1. Quit Visual Studio.

2. Open `regedit`, and navigate to the following Key:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\12.0_Config\Initialization

3. Delete the "ConfigPkgDefCacheTimestamp" value.

4. Start Visual Studio.




## Steps to replicate

1. Install XamarinVS 3.11.1594.

2. Launch Visual Studio, and then quit Visual Studio.

3. Set the time of the Windows system clock back 2 hours.

4. Install XamarinVS 4.0.1.93.

5. Launch Visual Studio, and then quit Visual Studio.




## Results

None of the Xamarin packages can load because Visual Studio has not yet refreshed the extension information in the registry. So VS is still looking for the files in the old locations.



### Error dialog messages when starting Visual Studio

> The 'IntegrationResolver' package did not load correctly.
> The 'FormsIntellisenseResolver' package did not load correctly.
> The 'UnifiedMigrationResolver' package did not load correctly.
> The 'XamarinShellPackage' package did not load correctly.
> The 'XamarinAndroidPackage' package did not load correctly.
> The 'XamarinIOSPackage' package did not load correctly.



### Example detailed error message from the `ActivityLog.xml`

> <source>VisualStudio</source>
> <description>End package load [IntegrationResolver]</description>
> <guid>{87122C53-DB8B-4BBF-8378-0CFF758087B9}</guid>
> <hr>80004005 - E_FAIL</hr>
> <errorinfo>
>     Could not load file or assembly 
>     'file:///C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Xamarin\Xamarin\3.11.1594.0\Xamarin.TestCloud.Integration.dll'
>     or one of its dependencies. The system cannot find the file
>     specified.
> </errorinfo>




## Xamarin version dependency: none

This problem is an upstream behavior of Visual Studio itself.

It therefore can affect _any_ upgrade of Xamarin (or for that matter, any upgrade of any other Visual Studio extension that uses different file paths in different versions).

BAD: XamarinVS 3.11.1594 -> XamarinVS 4.0.1.93
BAD: XamarinVS 4.0.1.89  -> XamarinVS 4.0.1.93




## Additional version info (brief)

Windows 10 64-bit
Visual Studio 2013 Update 5
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2016-02-09 09:21:36 UTC
## Additional notes: ineffective attempted fixes

I tried several different combinations of the more common workaround techniques that have helped in the past for similar error messages:

- Manually uninstall Xamarin

- Run `devenv /setup`

- Run `devenv /updateconfiguration`

- Manually update the timestamp of `extensions.configurationchanged`

- Manually reinstall and uninstall Xamarin 3.11.1594


No combination of those techniques was successful. Visual Studio still always skipped the extension refresh. Modifying the "ConfigPkgDefCacheTimestamp" registry value was the only effective way to get Visual Studio to complete the extension refresh process.
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2016-02-09 09:28:08 UTC
## This bug can almost certainly be marked "resolved upstream"

One of the reasons I'm filing this report is just to make this particular edge case more searchable. For example, Google currently returns 0 results for the following query:

https://www.google.com/search?q=%22ConfigPkgDefCacheTimestamp%22+package+did+not+load+correctly


And I don't necessarily think the Xamarin extensions should try to do anything new to avoid or warn about this scenario. After all, this problem affects other extensions the same way too and is quite rare. So I think it's probably fine to mark it as "resolved upstream."


Thanks!