Skip to content

Commit b310cea

Browse files
Support for .NET Core
1 parent d0b4de8 commit b310cea

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/WebCompilerVsix/Helpers/ProjectHelpers.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public static string GetRootFolder(this Project project)
9595

9696
public static void AddFileToProject(this Project project, string file, string itemType = null)
9797
{
98-
if (project.IsKind(ProjectTypes.ASPNET_5))
98+
if (project.IsKind(ProjectTypes.ASPNET_5, ProjectTypes.DOTNET_Core))
9999
return;
100100

101101
if (_dte.Solution.FindProjectItem(file) == null)
@@ -154,9 +154,15 @@ public static void AddNestedFile(string parentFile, string newFile, string itemT
154154
}
155155
}
156156

157-
public static bool IsKind(this Project project, string kindGuid)
157+
public static bool IsKind(this Project project, params string[] kindGuids)
158158
{
159-
return project.Kind.Equals(kindGuid, StringComparison.OrdinalIgnoreCase);
159+
foreach (var guid in kindGuids)
160+
{
161+
if (project.Kind.Equals(guid, StringComparison.OrdinalIgnoreCase))
162+
return true;
163+
}
164+
165+
return false;
160166
}
161167

162168
public static void DeleteFileFromProject(string file)
@@ -266,6 +272,7 @@ public static bool IsConfigFile(this ProjectItem item)
266272
public static class ProjectTypes
267273
{
268274
public const string ASPNET_5 = "{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}";
275+
public const string DOTNET_Core = "{9A19103F-16F7-4668-BE54-9A1E7A4F7556}";
269276
public const string WEBSITE_PROJECT = "{E24C65DC-7377-472B-9ABA-BC803B73C61A}";
270277
public const string UNIVERSAL_APP = "{262852C6-CD72-467D-83FE-5EEB1973A190}";
271278
public const string NODE_JS = "{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}";

0 commit comments

Comments
 (0)