diff options
author | Rodrigo Moya <rodrigo.moya@xamarin.com> | 2020-01-10 21:23:31 +0300 |
---|---|---|
committer | Rodrigo Moya <rodrigo.moya@xamarin.com> | 2020-01-10 21:23:31 +0300 |
commit | a993419042be2071180c5b36d08fdca8c4e48206 (patch) | |
tree | ebcecb1ec19710967b6add36ae9a0afa0c841473 /main | |
parent | 4993569a3955686ec720aede8fdc1f8e86535133 (diff) |
[AspNetCore] Don't create browser-based execution targets for Worker services
With the enabling of launchSettings.json support for Worker services,
we added support, by mistake, to run it on the user's installed
browsers, which is wrong, as Worker services are just console
applications.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1050466
Diffstat (limited to 'main')
-rw-r--r-- | main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore/AspNetCoreProjectExtension.cs | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore/AspNetCoreProjectExtension.cs b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore/AspNetCoreProjectExtension.cs index 136d4194cd..2cfa694241 100644 --- a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore/AspNetCoreProjectExtension.cs +++ b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore/AspNetCoreProjectExtension.cs @@ -178,24 +178,28 @@ namespace MonoDevelop.AspNetCore protected override IEnumerable<ExecutionTarget> OnGetExecutionTargets (OperationContext ctx, ConfigurationSelector configuration, SolutionItemRunConfiguration runConfig) { - var result = new List<ExecutionTarget> (); - foreach (var browser in IdeServices.DesktopService.GetApplications ("https://localhost", Ide.Desktop.DesktopApplicationRole.Viewer)) { - if (browser.IsDefault) { - if (Project.HasMultipleTargetFrameworks) { - result.InsertRange (0, GetMultipleTargetFrameworkExecutionTargets (browser)); + if (IsWeb) { + var result = new List<ExecutionTarget> (); + foreach (var browser in IdeServices.DesktopService.GetApplications ("https://localhost", Ide.Desktop.DesktopApplicationRole.Viewer)) { + if (browser.IsDefault) { + if (Project.HasMultipleTargetFrameworks) { + result.InsertRange (0, GetMultipleTargetFrameworkExecutionTargets (browser)); + } else { + result.Insert (0, new AspNetCoreExecutionTarget (browser)); + } } else { - result.Insert (0, new AspNetCoreExecutionTarget (browser)); - } - } else { - if (Project.HasMultipleTargetFrameworks) { - result.AddRange (GetMultipleTargetFrameworkExecutionTargets (browser)); - } else { - result.Add (new AspNetCoreExecutionTarget (browser)); + if (Project.HasMultipleTargetFrameworks) { + result.AddRange (GetMultipleTargetFrameworkExecutionTargets (browser)); + } else { + result.Add (new AspNetCoreExecutionTarget (browser)); + } } } - } - return result.Count > 0 ? result : base.OnGetExecutionTargets (configuration); + return result.Count > 0 ? result : base.OnGetExecutionTargets (configuration); + } else { + return base.OnGetExecutionTargets (configuration); + } } IEnumerable<ExecutionTarget> GetMultipleTargetFrameworkExecutionTargets (DesktopApplication browser) |