From 00c8a64190daae72849e83b68d95d0609beaf2ca Mon Sep 17 00:00:00 2001 From: cartermp Date: Mon, 4 May 2020 09:21:21 -0700 Subject: [PATCH] Warn about System.Web, don't reject (for now) --- src/MSBuild.Abstractions/MSBuildWorkspace.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/MSBuild.Abstractions/MSBuildWorkspace.cs b/src/MSBuild.Abstractions/MSBuildWorkspace.cs index bfef31a1a..93196756e 100644 --- a/src/MSBuild.Abstractions/MSBuildWorkspace.cs +++ b/src/MSBuild.Abstractions/MSBuildWorkspace.cs @@ -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); @@ -289,8 +294,7 @@ static void PrintGuidMessage(IEnumerable 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; }