Bug 12387 - iOS Build fails if WiX project is contained in the same solution as iOS project
Summary: iOS Build fails if WiX project is contained in the same solution as iOS project
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 1.1.x
Hardware: PC Windows
: Normal normal
Target Milestone: 1.2.x
Assignee: Marek Habersack
URL:
Depends on:
Blocks:
 
Reported: 2013-05-24 12:15 UTC by webmaster
Modified: 2017-03-01 14:31 UTC (History)
6 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:
RESOLVED FIXED

Description webmaster 2013-05-24 12:15:43 UTC
It appears the call to OAProject.get_UniqueName fails for WiX projects.  As soon as I remove them from the solution, this issue goes away.  This is likely the case for other 3rd-party project types also.  I would guess a try/catch/ignore around the call to get_UniqueName would be sufficient for your purposes.

This prevents me from using iOS in the same solution as my other stuff, which defeats the whole purpose of using Visual Studio with iOS. I need refactoring and other functions to work across all my projects.

stack trace:
Mono.IOS.VisualStudio.MonoTouchFlavoredProject Error: 0 : Deployment task failed with exception
System.AggregateException: One or more errors occurred. ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at Microsoft.VisualStudio.Package.Automation.OAProject.get_UniqueName()
   at Mono.VisualStudio.Extension.ExtensionMethods.FindProjectRecursive(Project project, String projectName)
   at Mono.VisualStudio.Extension.ExtensionMethods.FindProject(Solution solution, String projectName)
   at Mono.VisualStudio.Extension.TastyFlavoredProject.get_Project()
   at Mono.IOS.VisualStudio.MonoTouchFlavoredProject.<>c__DisplayClassa.<DeployApplicationAsync>b__9()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at Microsoft.VisualStudio.Package.Automation.OAProject.get_UniqueName()
   at Mono.VisualStudio.Extension.ExtensionMethods.FindProjectRecursive(Project project, String projectName)
   at Mono.VisualStudio.Extension.ExtensionMethods.FindProject(Solution solution, String projectName)
   at Mono.VisualStudio.Extension.TastyFlavoredProject.get_Project()
   at Mono.IOS.VisualStudio.MonoTouchFlavoredProject.<>c__DisplayClassa.<DeployApplicationAsync>b__9()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()<---
Comment 1 Marek Habersack 2013-05-27 05:29:47 UTC
Fixed. The fix should be available in the next release or the one after that, depending on QA.
Comment 3 PJ 2013-06-24 13:48:24 UTC
Do you have a small sample that demonstrates this issue for verification of the fix by any chance? Looks like this is slated to be released with 1.2 MTVS.
Comment 4 EB 2017-03-01 14:31:52 UTC
This bug appears again if there is a Wix project in your solution in version 4.3.0.784, with the exception that Android projects can't be deployed. Removing the Wix project resolves the issue. Error and Stack trace: 

Xamarin.VisualStudio.ProgressReport|Error|0|System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at Microsoft.VisualStudio.Package.Automation.OAProject.get_UniqueName()
   at Xamarin.VisualStudio.ProjectSystem.SolutionEvents.<>c__DisplayClass85_1.<GetStartupProjects>b__1(String name) in C:\d\lanes\4033\73f58d6d\source\xamarinvs\src\Core\VisualStudio\ProjectSystem\SolutionEvents.cs:line 311
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at Xamarin.VisualStudio.ProjectSystem.SolutionEvents.<>c__DisplayClass85_0.<GetStartupProjects>b__0(Project project) in C:\d\lanes\4033\73f58d6d\source\xamarinvs\src\Core\VisualStudio\ProjectSystem\SolutionEvents.cs:line 311
   at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Xamarin.VisualStudio.ProjectSystem.SolutionEvents.GetStartupProjects() in C:\d\lanes\4033\73f58d6d\source\xamarinvs\src\Core\VisualStudio\ProjectSystem\SolutionEvents.cs:line 309
   at Xamarin.VisualStudio.ProjectSystem.SolutionState.get_StartupProjects() in C:\d\lanes\4033\73f58d6d\source\xamarinvs\src\Core\VisualStudio\ProjectSystem\SolutionState.cs:line 53
   at Xamarin.VisualStudio.Android.CommandHandlers.DeployCommandHandler.MoreThanOneProjectHasSameDevice(ISolutionState solutionState, DeployCommand command) in C:\d\lanes\4033\73f58d6d\source\xamarinvs\src\Core\VisualStudio.Android\CommandHandlers\DeployCommandHandler.cs:line 86
   at Xamarin.VisualStudio.Android.CommandHandlers.DeployCommandHandler.CanExecute(DeployCommand command, IProgressReport progress) in C:\d\lanes\4033\73f58d6d\source\xamarinvs\src\Core\VisualStudio.Android\CommandHandlers\DeployCommandHandler.cs:line 63
   at Xamarin.VisualStudio.Commands.CommandHandlerBase`2.Execute(TCommand command, CancellationToken cancellationToken) in C:\d\lanes\4033\73f58d6d\source\xamarinvs\src\Core\VisualStudio\Commands\CommandHandlerBase.cs:line 132