Bug 23220 - [XVS.iOS 3.6] "project types may not be installed" error after upgrade
Summary: [XVS.iOS 3.6] "project types may not be installed" error after upgrade
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 3.6
Hardware: PC Windows
: --- critical
Target Milestone: 3.6
Assignee: vsx
URL:
: 23173 ()
Depends on:
Blocks:
 
Reported: 2014-09-21 03:12 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2014-10-07 13:44 UTC (History)
14 users (show)

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

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:
VERIFIED FIXED

Description Brendan Zagaeski (Xamarin Team, assistant) 2014-09-21 03:12:04 UTC
For some users the upgrade to XamarinVS 3.6.245 is leading to a "project types may not be installed" error for Xamarin.iOS projects.


Reported on the forums [1], in another bug report [2], and in email support cases.

> [1] http://forums.xamarin.com/discussion/24316/ios-project-is-unsupported
> [2] https://bugzilla.xamarin.com/show_bug.cgi?id=23173


It looks like this might be caused by a mistake during installation. Uninstalling and reinstalling seems to have helped in at least a few cases. More instructions about reinstalling or downgrading can be found here:
> http://forums.xamarin.com/discussion/comment/77496/#Comment_77496


## Steps to reproduce

Note: these steps depend on starting with some particular system state. So far I have not found a way to get into that particular system state, so I have not yet been able to reproduce the problem.


1. Start with a system that is running Xamarin 3.5 and can successfully load Xamarin.iOS projects in Visual Studio.

2. Run the Xamarin 3.6 upgrade via "Tools -> Options -> Xamarin -> iOS Settings -> Xamarin for Visual Studio Updates -> Notify me about Stable updates. -> Check Now".

3. Perform the corresponding upgrade to Xamarin.iOS 8.0.0.62 on the Mac build host via Xamarin Studio.

4. Re-open the "Xamarin.iOS Build Host" app on the Mac.

5. Re-open Visual Studio and run the SDK sync process. If the SDK sync system tray message bubble doesn't appear automatically, check for SDK updates manually via "Tools -> Options -> Xamarin -> iOS Settings -> SDK Synchronization -> Check Now".

6. Quit and reopen Visual Studio.

7. Attempt to open an existing Xamarin.iOS project or create a new "Classic API -> iPhone -> Single View App".



## Results

### In several of the reports, at step 7 Visual Studio claims that Xamarin.iOS projects are "unsupported"

#### When opening existing projects

> Review Project And Solution Changes
> 
> These projects are either not supported or need project behavior
> impacting modifications to open in this version of Visual Studio.
> Projects not displayed either require no changes or will automatically
> be modified such that behavior is not impacted.  For details, see More
> information.
> 
> Unsupported
> 
> This version of Visual Studio is unable to open the following
> projects. The project types may not be installed or this version of
> Visual Studio may not support them.  For more information on enabling
> these project types or otherwise migrating your assets, please see the
> details in the "Migration Report" displayed after clicking OK.
> 
> ..\App.iOS\App.iOS.csproj
>
> This information will be written to the upgrade log file in the
> solution directory.

#### When creating a new project

> A problem was encountered creating the sub project 'App.iOS'.
> The project file '\..\Temp\vck5q5ob.32n\Temp\App.iOS.csproj'
> cannot be opened.
> 
> There is a missing project subtype.  Subtype:
> '{6BC8ED88-2882-458C-8E55-DFD12B67127B}' is unsupported by this installation.




### At least in a few of the reports (possibly all), the MonoTouchPackage fails to load correctly

#### Error Dialog

> The 'MonoTouchPackage' package did not load correctly.
> 
> The problem may have been caused by a configuration change
> or by the installation of another extension. You can get
> more information by examining the file
> 'C:\Users\Windows User\AppData\Roaming\Microsoft\VisualStudio\12.0\ActivityLog.xml'.


#### Stack trace 1 from devenv*.log (ActivationException)

> Xamarin.VisualStudio.IOS.MonoTouchPackage Warning: 0 : [2014-09-19 20:58:41.8] Initializing Xamarin.VisualStudio.IOS.MonoTouchPackage.
> Xamarin.VisualStudio.IOS.Utilities.ErrorReportManager Error: 0 : [2014-09-19 20:58:43.2] Xamarin.iOS encountered the following error(s):
> Xamarin.VisualStudio.IOS.MonoTouchPackage Error: 0 : [2014-09-19 20:58:43.5] There was an error attempting to initialize the Xamarin.iOS extension.
> Microsoft.Practices.ServiceLocation.ActivationException: Activation error occured while trying to get instance of type IBuildHost, key "" ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Debugger.Interop.Internal, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
>    at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
>    at System.Reflection.RuntimeAssembly.GetExportedTypes()
>    at Clide.Composition.ServicesExportProvider.<FindInDomain>b__5(Assembly asm)
>    at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
>    at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
>    at Clide.Composition.ServicesExportProvider.FindInDomain(String serviceTypeName)
>    at Clide.Composition.ServicesExportProvider.MapType(String serviceTypeName)
>    at Clide.Composition.ServicesExportProvider.<GetExportsCore>b__0(String typeName)
>    at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
>    at Clide.Composition.ServicesExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
>    at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
>    at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
>    at System.ComponentModel.Composition.Hosting.AggregateExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
>    at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
>    at System.ComponentModel.Composition.Hosting.CompositionContainer.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
>    at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
>    at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
>    at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportsCore(Type type, Type metadataViewType, String contractName, ImportCardinality cardinality)
>    at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportsCore[T](String contractName)
>    at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports[T](String contractName)
>    at Clide.Composition.ExportsServiceLocator.DoGetInstance(Type serviceType, String key)
>    at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
>    --- End of inner exception stack trace ---
>    at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
>    at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService]()
>    at Xamarin.VisualStudio.IOS.MonoTouchPackage.Initialize()
>    at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)


#### Stack trace 2 from devenv*.log (NullReferenceException)

> Xamarin.VisualStudio.IOS.MonoTouchPackage Warning: 0 : [2014-09-19 21:01:28.4] Initializing Xamarin.VisualStudio.IOS.MonoTouchPackage.
> Xamarin.VisualStudio.IOS.Utilities.ErrorReportManager Error: 0 : [2014-09-19 21:01:28.5] Xamarin.iOS encountered the following error(s):
> Xamarin.VisualStudio.IOS.MonoTouchPackage Error: 0 : [2014-09-19 21:01:28.6] There was an error attempting to initialize the Xamarin.iOS extension.
> System.NullReferenceException: Object reference not set to an instance of an object.
>    at MonoTouch.Design.LoggingService.RedirectToFile(String logFileName, TextWriter writer)
>    at Xamarin.VisualStudio.IOS.MonoTouchPackage.SetupLogging()
>    at Xamarin.VisualStudio.IOS.MonoTouchPackage.Initialize()
>    at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)



## Additional version information

Visual Studio 2013 Update 3
(In the 3 reports that mention VS version, VS 2013 Update 3 is listed as the installed version.)

Xcode 6
(In both reports that mention Xcode version, Xcode 6 is listed as the installed version.)
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2014-09-21 03:16:01 UTC
*** Bug 23173 has been marked as a duplicate of this bug. ***
Comment 4 apollo_maverick 2014-09-21 03:22:51 UTC
even though haven't sync SDK, the problem appears anyway
Comment 5 apollo_maverick 2014-09-21 03:34:30 UTC
and Xamarin for VS 3.7.126 got a similar problem, even worse, both X.Android and X.iOS affected.

open X.Android and X.iOS projects, it shows: C:\Users\XXX\Documents\Visual Studio 2013\Projects\AndroidApps\App1\App1.csproj : error  : Activation error occured while trying to get instance of type IVsPackageInstallerEvents, key ""

in VS Output box from Solution.

I don't think it's about license activation.

Checked, no log for this problem.
Comment 6 Todd Aspeotis 2014-09-21 05:12:06 UTC
After upgrading to the latest *stable* version of Xamarin Develop/VS Add-In etc. I was able to use it a couple of times (i.e. VS had been restarted several times since the upgrade, and I was able to edit the project) but now the VS add-in doesn't work.

  <entry>
    <record>1006</record>
    <time>2014/09/21 09:06:32.244</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>SetSite failed for package [MonoTouchPackage]</description>
    <guid>{77875FA9-01E7-4FEA-8E77-DFE942355CA1}</guid>
    <hr>80131500</hr>
    <errorinfo>Activation error occured while trying to get instance of type IBuildHost, key ""</errorinfo>
  </entry>
Comment 7 Todd Aspeotis 2014-09-21 05:13:42 UTC
Sorry to add another comment in quick succession (I know these cause emails to be sent), but opening the build host on my Mac before launching VS and opening a project caused the add-in and projects to load.
Comment 8 Frank Buckley 2014-09-22 05:06:50 UTC
Using 3.6.245, I find that running VS as Administrator, then opening a solution with a single IOS project in it almost always (but not always) fixes the problem and I can then go ahead and load our solution with multiple IOS projects successfully.
Comment 9 apollo_maverick 2014-09-22 12:14:08 UTC
running VS as Administrator doesn't work
Comment 10 Frank Buckley 2014-09-22 12:40:08 UTC
Clearing out %tmp% also seems to help.

I have not had the time to test combinations of clearing %tmp%, many/few IOS projects in solutions and with/without Administrator privileges.

Also, once I am past error and VS is opening IOS projects I can often close and reopen solutions without error. It is not clear what causes the error to resurface.
Comment 11 David Stetz 2014-09-22 14:20:37 UTC
Clearing out %tmp% and running as administrator does not work for me.
Comment 15 Brendan Zagaeski (Xamarin Team, assistant) 2014-09-23 15:31:03 UTC
Update: a hotfix candidate build for this issue is in review to be published to the stable channel.


Just to confirm, I suspect this fix will also be applied to the 3.7 branch, correct? Maybe that will take care of the "instance of type IVsPackageInstallerEvents" error? If not, I can set up another bug for that.

Thanks!
Comment 16 Ian Ceicys 2014-09-23 16:34:49 UTC
Marking this bug as resolved fixed. 

QA manually tested this hotfix against the '3.6 upgrade for VS' and the Mac Build-Host(Xamarin.iOS 8.0.0.62) on Visual Studio 2013 Update 3 Premium and Ultimate editions.

An automated C# CodedUI test was created and executed 8 times to confirm the issue was resolved. The C# CodedUI is committed to the VS Extensions repo under CodedUITest.
Comment 18 xamarinbugzilla 2014-09-25 17:11:21 UTC
I'm just now seeing this from the beta channel ios 8.2.57.0 and xamarin 3.7.126.0 - is the fix only on stable?
Comment 19 PJ 2014-09-25 17:15:35 UTC
Yes, the fix is only on stable currently. We'll be re-releasing a new version of the current Betas soon - potentially as early as tomorrow.
Comment 20 apollo_maverick 2014-09-27 06:30:32 UTC
@PJ where's the new beta? thanks
Comment 21 apollo_maverick 2014-09-27 06:34:37 UTC
@PJ where's the new beta? thanks
Comment 22 softlion 2014-09-29 06:12:26 UTC
+1
Comment 23 David Schwegler 2014-09-29 15:32:30 UTC
I also am blocked on this.