diff options
author | Rodrigo Moya <rodrigo.moya@xamarin.com> | 2020-01-10 21:15:53 +0300 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2020-01-13 21:13:03 +0300 |
commit | 1e2564c75dc242d32aa1d3f0e3ba2afd1491d109 (patch) | |
tree | 1390309417950f5aadc8ffc4330297c5fe9c3419 /main/src | |
parent | b9b2dc8e3586215a6cfff97f393ccc63bda12986 (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/src')
-rw-r--r-- | main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore/AspNetCoreProjectExtension.cs | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore/AspNetCoreProjectExtension.cs b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore/AspNetCoreProjectExtension.cs index 22d3421074..c2733f26c2 100644 --- a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore/AspNetCoreProjectExtension.cs +++ b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore/AspNetCoreProjectExtension.cs @@ -178,26 +178,30 @@ namespace MonoDevelop.AspNetCore protected override IEnumerable<ExecutionTarget> OnGetExecutionTargets (OperationContext ctx, ConfigurationSelector configuration, SolutionItemRunConfiguration runConfig) { - var result = new ExecutionTargetGroup (GettextCatalog.GetString ("Browser"), "MonoDevelop.AspNetCore.BrowserExecutionTargets"); - 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 ExecutionTargetGroup (GettextCatalog.GetString ("Browser"), "MonoDevelop.AspNetCore.BrowserExecutionTargets"); + 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 - ? new ExecutionTarget [] { result } - : base.OnGetExecutionTargets (ctx, configuration, runConfig); + return result.Count > 0 + ? new ExecutionTarget [] { result } + : base.OnGetExecutionTargets (ctx, configuration, runConfig); + } else { + return base.OnGetExecutionTargets (ctx, configuration, runConfig); + } } IEnumerable<ExecutionTarget> GetMultipleTargetFrameworkExecutionTargets (DesktopApplication browser) |