Skip to content

Commit 777deae

Browse files
authored
Try resetting the toolset framework env variable
Try removing windowsforms from the not expected reference names
1 parent c1423e0 commit 777deae

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

test/Microsoft.NET.Build.Tests/GivenFrameworkReferences.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ public void WindowsFormsFrameworkReference(bool selfContained)
887887
TestFrameworkReferenceProfiles(
888888
frameworkReferences: new[] { "Microsoft.WindowsDesktop.App.WindowsForms" },
889889
expectedReferenceNames: new[] { "Microsoft.Win32.Registry", "System.Windows.Forms" },
890-
notExpectedReferenceNames: new[] { "WindowsFormsIntegration" },
890+
notExpectedReferenceNames: Enumerable.Empty<string>(),
891891
selfContained);
892892
}
893893

@@ -899,7 +899,7 @@ public void WPFFrameworkReference(bool selfContained)
899899
TestFrameworkReferenceProfiles(
900900
frameworkReferences: new[] { "Microsoft.WindowsDesktop.App.WPF" },
901901
expectedReferenceNames: new[] { "Microsoft.Win32.Registry", "System.Windows.Presentation" },
902-
notExpectedReferenceNames: new[] { "WindowsFormsIntegration" },
902+
notExpectedReferenceNames: Enumerable.Empty<string>(),
903903
selfContained);
904904
}
905905

@@ -911,7 +911,7 @@ public void WindowsFormAndWPFFrameworkReference(bool selfContained)
911911
TestFrameworkReferenceProfiles(
912912
frameworkReferences: new[] { "Microsoft.WindowsDesktop.App.WindowsForms", "Microsoft.WindowsDesktop.App.WPF" },
913913
expectedReferenceNames: new[] { "Microsoft.Win32.Registry", "System.Windows.Forms", "System.Windows.Presentation" },
914-
notExpectedReferenceNames: new[] { "WindowsFormsIntegration" },
914+
notExpectedReferenceNames: Enumerable.Empty<string>(),
915915
selfContained);
916916
}
917917

test/Microsoft.NET.Restore.Tests/GivenThatWeWantToUseFrameworkRoslyn.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public void It_downloads_Microsoft_Net_Compilers_Toolset_Framework_when_MSBuild_
6565
var customPackagesDir = Path.Combine(testAsset.Path, "nuget-packages");
6666

6767
testAsset.GetRestoreCommand(Log, relativePath: testProjectName)
68-
.WithEnvironmentVariable("NUGET_PACKAGES", customPackagesDir)
68+
.WithEnvironmentVariable("NUGET_PACKAGES", "")
69+
.WithEnvironmentVariable("BuildWithNetFrameworkHostedCompiler", customPackagesDir)
6970
.Execute().Should().Pass();
7071

7172
var toolsetPackageDir = Path.Combine(customPackagesDir, "microsoft.net.sdk.compilers.toolset");
@@ -76,6 +77,7 @@ public void It_downloads_Microsoft_Net_Compilers_Toolset_Framework_when_MSBuild_
7677

7778
new BuildCommand(testAsset)
7879
.WithEnvironmentVariable("NUGET_PACKAGES", customPackagesDir)
80+
.WithEnvironmentVariable("BuildWithNetFrameworkHostedCompiler", "")
7981
.Execute().Should().Pass().And
8082
.HaveStdOutContaining(Path.Combine(toolsetPackageDir, toolsetPackageVersion, "csc.exe") + " /noconfig");
8183
}

0 commit comments

Comments
 (0)