Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

Commit

Permalink
[AspNetCore] Don't create browser-based execution targets for Worker …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Rodrigo Moya authored and rodrmoya committed Jan 13, 2020
1 parent b9b2dc8 commit 1e2564c
Showing 1 changed file with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,26 +178,30 @@ private ExecutionCommand CreateAspNetCoreExecutionCommand (ConfigurationSelector

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)
Expand Down

0 comments on commit 1e2564c

Please sign in to comment.