diff options
author | Rodrigo Moya <rodrigo.moya@xamarin.com> | 2019-12-30 14:50:16 +0300 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2020-01-02 18:03:31 +0300 |
commit | bb0a80ff6d4ecc8a7aedbb8e5a656e811e15a377 (patch) | |
tree | 6ef14b14add19d0559ec4c83c6b44034f4cf38c1 /main/src/addins/MonoDevelop.DotNetCore | |
parent | 988a29d6302ead741b57dc1a9a534a4af43f1fc6 (diff) |
[AspNetCore] Enable support for launchSettings.json in Worker services
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1024557
Diffstat (limited to 'main/src/addins/MonoDevelop.DotNetCore')
-rw-r--r-- | main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreProjectExtension.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreProjectExtension.cs b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreProjectExtension.cs index ced8a441c4..e62b73f956 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreProjectExtension.cs +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreProjectExtension.cs @@ -75,7 +75,7 @@ namespace MonoDevelop.DotNetCore protected override bool SupportsObject (WorkspaceObject item) { - return DotNetCoreSupportsObject (item) && !IsWebProject ((DotNetProject)item); + return DotNetCoreSupportsObject (item) && !SupportsLaunchSettings ((DotNetProject)item); } protected bool DotNetCoreSupportsObject (WorkspaceObject item) @@ -404,7 +404,13 @@ namespace MonoDevelop.DotNetCore public bool HasSdk => Project.MSBuildProject.GetReferencedSDKs ().Length > 0; - protected bool IsWebProject (DotNetProject project) + protected static bool SupportsLaunchSettings (DotNetProject project) + { + return IsWebProject (project) || + project.MSBuildProject.GetReferencedSDKs ().FirstOrDefault (x => x.IndexOf ("Microsoft.NET.Sdk.Worker", StringComparison.OrdinalIgnoreCase) != -1) != null; + } + + protected static bool IsWebProject (DotNetProject project) { return (project.MSBuildProject.GetReferencedSDKs ().FirstOrDefault (x => x.IndexOf ("Microsoft.NET.Sdk.Web", StringComparison.OrdinalIgnoreCase) != -1) != null); } |