Bug 23173 - 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 ""
Summary: There was an error attempting to initialize the Xamarin.iOS extension. Micros...
Status: VERIFIED DUPLICATE of bug 23220
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 3.6
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-09-19 01:48 UTC by apollo_maverick
Modified: 2015-01-06 03:45 UTC (History)
4 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 DUPLICATE of bug 23220

Description apollo_maverick 2014-09-19 01:48:11 UTC
Xamarin 3.6.239 3.6.245 all encountered this problem after first running VS and configuring mac build host in the Options.
VS2013 Update 3

repro steps:
1) install
2) start VS 2013 Update 3, and config mac build host in the Options.
3) close VS 2013 Update 3
4) start VS 2013 Update 3,
 open a solution containing at least one iOS project
OR 
 got to the Xamarin.iOS page in the Options

5) you'll see the problem.

Xamarin.VisualStudio.IOS.MonoTouchPackage Error: 0 : [2014-09-19 13:29:01.2] 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.Project.Contracts, 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)
Comment 1 Miha Markic 2014-09-20 10:58:36 UTC
Similar here. That you described and this. To me it happens when trying to create a new iOS project.

Xamarin.VisualStudio.TastyPackage Information: 0 : [2014-09-20 16:52:57.7] Hooked up SDB tracing adapter
Xamarin.VisualStudio.TastyPackage Information: 0 : [2014-09-20 16:52:57.8] Initialization finished
Xamarin.VisualStudio.IOS.MonoTouchPackage Warning: 0 : [2014-09-20 16:52:57.9] Initializing Xamarin.VisualStudio.IOS.MonoTouchPackage.
Xamarin.VisualStudio.IOS.Utilities.ErrorReportManager Error: 0 : [2014-09-20 16:52:58.0] Xamarin.iOS encountered the following error(s):
Xamarin.VisualStudio.IOS.MonoTouchPackage Error: 0 : [2014-09-20 16:52:58.1] 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)
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2014-09-21 03:16:01 UTC
Thanks for the reports and the stack traces! I'm consolidating the information from this report along with a few other similar reports into a new bug, so I'll mark this bug as duplicate of that one.

*** This bug has been marked as a duplicate of bug 23220 ***
Comment 3 Saurabh 2015-01-06 03:45:31 UTC
As per bug 23220 changing the status to verified.