diff --git a/src/LibraryManager.Vsix/Constants.cs b/src/LibraryManager.Vsix/Constants.cs
index ff2025f5..b3f37588 100644
--- a/src/LibraryManager.Vsix/Constants.cs
+++ b/src/LibraryManager.Vsix/Constants.cs
@@ -14,6 +14,13 @@ internal static class Constants
public const string ErrorCodeLink = "https://github.com/aspnet/LibraryManager/wiki/Error-codes#{0}";
public const string WAP = "{349C5851-65DF-11DA-9384-00065B846F21}";
public const string WebsiteProject = "{E24C65DC-7377-472B-9ABA-BC803B73C61A}";
+ ///
+ /// Project capability for .NET web projects. Used only for UI context rules.
+ ///
public const string DotNetCoreWebCapability = "DotNetCoreWeb";
+ ///
+ /// Project capability for CPS-based projects. Used to determine how to add/remove items to the project.
+ ///
+ public const string CpsCapability = "CPS";
}
}
diff --git a/src/LibraryManager.Vsix/Contracts/HostInteraction.cs b/src/LibraryManager.Vsix/Contracts/HostInteraction.cs
index 0fb44bcd..7f171c67 100644
--- a/src/LibraryManager.Vsix/Contracts/HostInteraction.cs
+++ b/src/LibraryManager.Vsix/Contracts/HostInteraction.cs
@@ -85,9 +85,9 @@ public async Task DeleteFilesAsync (IEnumerable relativeFilePaths,
//Delete from project
Project project = VsHelpers.GetDTEProjectFromConfig(_configFilePath);
- bool isCoreProject = await VsHelpers.IsDotNetCoreWebProjectAsync(project);
+ bool isCpsProject = await VsHelpers.IsCpsProject(project);
- if (!isCoreProject)
+ if (!isCpsProject)
{
var logAction = new Action((message, level) => { Logger.Log(message, level); });
bool deleteFromProject = await VsHelpers.DeleteFilesFromProjectAsync(project, absolutePaths, logAction, cancellationToken);
diff --git a/src/LibraryManager.Vsix/Shared/VsHelpers.cs b/src/LibraryManager.Vsix/Shared/VsHelpers.cs
index c4c9480e..f6e07c82 100644
--- a/src/LibraryManager.Vsix/Shared/VsHelpers.cs
+++ b/src/LibraryManager.Vsix/Shared/VsHelpers.cs
@@ -109,7 +109,7 @@ public static async Task AddFileToProjectAsync(this Project project, string file
{
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
- if (IsCapabilityMatch(project, Constants.DotNetCoreWebCapability))
+ if (IsCapabilityMatch(project, Constants.CpsCapability))
{
return;
}
@@ -140,7 +140,7 @@ public static async Task AddFilesToProjectAsync(Project project, IEnumerable IsDotNetCoreWebProjectAsync(Project project)
+ ///
+ /// Returns whether the DTE project is a CPS-based project
+ ///
+ public static async Task IsCpsProject(Project project)
{
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
- if (project == null || IsCapabilityMatch(project, Constants.DotNetCoreWebCapability))
+ if (project == null || IsCapabilityMatch(project, Constants.CpsCapability))
{
return true;
}