Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
Warn about System.Web, don't reject (for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
cartermp committed May 4, 2020
1 parent 0ab29a7 commit 00c8a64
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/MSBuild.Abstractions/MSBuildWorkspace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ private bool IsSupportedProjectType(MSBuildProjectRootElement root)
return false;
}

if (root.ItemGroups.Any(ig => ig.Items.Any(ProjectItemHelpers.IsReferencingSystemWeb)))
{
Console.WriteLine($"{root.FullPath} contains a reference to System.Web, which is not supported on .NET Core. You may have significant work ahead of you to fully port this project.");
}

// Lots of wild old project types have project type guids that the old project system uses to light things up!
// Also some references that are incompatible.
var projectType = GetProjectSupportType(root);
Expand Down Expand Up @@ -289,8 +294,7 @@ static void PrintGuidMessage(IEnumerable<string> allSupportedProjectTypeGuids, I

static ProjectSupportType GetProjectSupportType(MSBuildProjectRootElement root)
{
if (root.PropertyGroups.Any(pg => pg.Properties.Any(ProjectPropertyHelpers.IsLegacyWebProjectTypeGuidsProperty))
|| root.ItemGroups.Any(ig => ig.Items.Any(ProjectItemHelpers.IsReferencingSystemWeb)))
if (root.PropertyGroups.Any(pg => pg.Properties.Any(ProjectPropertyHelpers.IsLegacyWebProjectTypeGuidsProperty)))
{
return ProjectSupportType.LegacyWeb;
}
Expand Down

0 comments on commit 00c8a64

Please sign in to comment.