Skip to content

Commit 4c8fb55

Browse files
authored
Revert "[release/8.0.2xx] NGEN Microsoft.DotNet.MSBuildSdkResolver.dll and its dependencies (#17750)" (#19112)
This reverts commit f0c4e4e. Fixes [AB#1994786](https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1994786/) The MSBuild change which took advantage of this was reverted in 17.9 because it introduced issues in installations that don't have the .NET SDK component installed. We are fixing the bug in 9.0 by making changes to the dependencies of `Microsoft.DotNet.MSBuildSdkResolver` (see dotnet/sdk#39573) so this should stay in main. I am reverting it only in 8.0.3xx / 17.10 to fix the `Build_Ngen_InvalidAssemblyCount` counter which was flagged as a regression by PerfDDRITs.
1 parent 15de083 commit 4c8fb55

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

src/core-sdk-tasks/GenerateMSBuildExtensionsSWR.cs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ public override bool Execute()
2424

2525
AddFolder(sb,
2626
@"MSBuildSdkResolver",
27-
@"MSBuild\Current\Bin\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver",
28-
ngenAssemblies: true);
27+
@"MSBuild\Current\Bin\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver");
2928

3029
AddFolder(sb,
3130
@"msbuildExtensions",
@@ -40,7 +39,7 @@ public override bool Execute()
4039
return true;
4140
}
4241

43-
private void AddFolder(StringBuilder sb, string relativeSourcePath, string swrInstallDir, bool ngenAssemblies = false)
42+
private void AddFolder(StringBuilder sb, string relativeSourcePath, string swrInstallDir)
4443
{
4544
string sourceFolder = Path.Combine(MSBuildExtensionsLayoutDirectory, relativeSourcePath);
4645
var files = Directory.GetFiles(sourceFolder)
@@ -56,16 +55,7 @@ private void AddFolder(StringBuilder sb, string relativeSourcePath, string swrIn
5655
{
5756
sb.Append(@" file source=""$(PkgVS_Redist_Common_Net_Core_SDK_MSBuildExtensions)\");
5857
sb.Append(Path.Combine(relativeSourcePath, Path.GetFileName(file)));
59-
sb.Append('"');
60-
61-
if (ngenAssemblies && file.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))
62-
{
63-
sb.Append(@" vs.file.ngenApplications=""[installDir]\Common7\IDE\vsn.exe""");
64-
sb.Append(@" vs.file.ngenApplications=""[installDir]\MSBuild\Current\Bin\MSBuild.exe""");
65-
sb.Append(" vs.file.ngenArchitecture=all");
66-
}
67-
68-
sb.AppendLine();
58+
sb.AppendLine("\"");
6959
}
7060

7161
sb.AppendLine();
@@ -77,7 +67,6 @@ private void AddFolder(StringBuilder sb, string relativeSourcePath, string swrIn
7767
string newRelativeSourcePath = Path.Combine(relativeSourcePath, subfolderName);
7868
string newSwrInstallDir = Path.Combine(swrInstallDir, subfolderName);
7969

80-
// Don't propagate ngenAssemblies to subdirectories.
8170
AddFolder(sb, newRelativeSourcePath, newSwrInstallDir);
8271
}
8372
}

0 commit comments

Comments
 (0)