From b82c6a2b7d451212fb0b2e32ca4d5d86c953d81a Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 20 Apr 2022 15:30:08 -0500 Subject: Upgrade dnchost's nethost dependency to .NET 6.0.4. --- src/ext/Bal/bal.cmd | 4 ++ src/ext/Bal/dnchost/dnchost.vcxproj | 2 +- src/ext/Bal/dnchost/packages.config | 6 +-- .../WixToolsetTest.ManagedHost/DncHostFixture.cs | 47 ++++++++++++++++++++++ .../test/WixToolsetTest.ManagedHost/TestEngine.cs | 13 +++--- .../WixToolsetTest.ManagedHost.csproj | 2 +- .../EarliestCoreBundleFDDx86.wixproj | 6 +++ .../FrameworkDependentBundle.wxs | 15 +++++++ .../FrameworkDependentBundle.wxs | 15 +++++++ .../LatestCoreBundleFDDx86.wixproj | 6 +++ src/ext/Bal/test/examples/examples.proj | 3 ++ 11 files changed, 108 insertions(+), 11 deletions(-) create mode 100644 src/ext/Bal/test/examples/EarliestCoreBundleFDDx86/EarliestCoreBundleFDDx86.wixproj create mode 100644 src/ext/Bal/test/examples/EarliestCoreBundleFDDx86/FrameworkDependentBundle.wxs create mode 100644 src/ext/Bal/test/examples/LatestCoreBundleFDDx86/FrameworkDependentBundle.wxs create mode 100644 src/ext/Bal/test/examples/LatestCoreBundleFDDx86/LatestCoreBundleFDDx86.wixproj (limited to 'src/ext') diff --git a/src/ext/Bal/bal.cmd b/src/ext/Bal/bal.cmd index 8864bbb6..7a005cfe 100644 --- a/src/ext/Bal/bal.cmd +++ b/src/ext/Bal/bal.cmd @@ -22,6 +22,10 @@ msbuild -p:Configuration=%_C%;Platform=x86 mbahost\mbahost.vcxproj || exit /b msbuild -p:Configuration=%_C%;Platform=x64 mbahost\mbahost.vcxproj || exit /b msbuild -p:Configuration=%_C%;Platform=ARM64 mbahost\mbahost.vcxproj || exit /b +msbuild -p:Configuration=%_C%;Platform=x86 test\examples\TestEngine\Example.TestEngine.vcxproj || exit /b +msbuild -p:Configuration=%_C%;Platform=x64 test\examples\TestEngine\Example.TestEngine.vcxproj || exit /b +msbuild -p:Configuration=%_C%;Platform=ARM64 test\examples\TestEngine\Example.TestEngine.vcxproj || exit /b + msbuild -p:Configuration=%_C% || exit /b dotnet test test\WixToolsetTest.Dnc.HostGenerator -c %_C% --nologo --no-build -l "trx;LogFileName=%_L%\TestResults\WixToolsetTest.Dnc.HostGenerator.trx" || exit /b diff --git a/src/ext/Bal/dnchost/dnchost.vcxproj b/src/ext/Bal/dnchost/dnchost.vcxproj index 1fd2ebed..ca0c09d6 100644 --- a/src/ext/Bal/dnchost/dnchost.vcxproj +++ b/src/ext/Bal/dnchost/dnchost.vcxproj @@ -49,7 +49,7 @@ $(Platform) x86 - ..\..\..\..\packages\runtime.win-$(NetHostPlatform).Microsoft.NETCore.DotNetAppHost.5.0.0\runtimes\win-$(NetHostPlatform)\native\ + ..\..\..\..\packages\runtime.win-$(NetHostPlatform).Microsoft.NETCore.DotNetAppHost.6.0.4\runtimes\win-$(NetHostPlatform)\native\ $(BaseOutputPath)obj;$(NetHostPath) shlwapi.lib;$(NetHostPath)libnethost.lib diff --git a/src/ext/Bal/dnchost/packages.config b/src/ext/Bal/dnchost/packages.config index 78fa970f..1c7505e7 100644 --- a/src/ext/Bal/dnchost/packages.config +++ b/src/ext/Bal/dnchost/packages.config @@ -1,6 +1,6 @@ - - - + + + \ No newline at end of file diff --git a/src/ext/Bal/test/WixToolsetTest.ManagedHost/DncHostFixture.cs b/src/ext/Bal/test/WixToolsetTest.ManagedHost/DncHostFixture.cs index 14b80fe8..25856f4d 100644 --- a/src/ext/Bal/test/WixToolsetTest.ManagedHost/DncHostFixture.cs +++ b/src/ext/Bal/test/WixToolsetTest.ManagedHost/DncHostFixture.cs @@ -2,6 +2,7 @@ namespace WixToolsetTest.ManagedHost { + using System; using WixBuildTools.TestSupport; using Xunit; @@ -29,6 +30,29 @@ namespace WixToolsetTest.ManagedHost } } + [Fact(Skip = "Requires .NET Core 3.1 x86 runtime which might be missing")] + public void CanLoadFDDx86EarliestCoreMBA() + { + // https://github.com/microsoft/vstest/issues/3586 + Environment.SetEnvironmentVariable("DOTNET_ROOT", null); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var bundleFile = TestData.Get(bundleBasePath, "EarliestCoreBundleFDDx86.exe"); + var testEngine = new TestEngine(); + + var result = testEngine.RunShutdownEngine(bundleFile, baseFolder, x86: true); + WixAssert.CompareLineByLine(new[] + { + "Loading .NET Core FDD bootstrapper application.", + "Creating BA thread to run asynchronously.", + "EarliestCoreBA", + "Shutdown,ReloadBootstrapper,0", + }, result.Output.ToArray()); + } + } + [Fact] public void CanLoadSCDEarliestCoreMBA() { @@ -115,6 +139,29 @@ namespace WixToolsetTest.ManagedHost } } + [Fact] + public void CanLoadFDDx86LatestCoreMBA() + { + // https://github.com/microsoft/vstest/issues/3586 + Environment.SetEnvironmentVariable("DOTNET_ROOT", null); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var bundleFile = TestData.Get(bundleBasePath, "LatestCoreBundleFDDx86.exe"); + var testEngine = new TestEngine(); + + var result = testEngine.RunShutdownEngine(bundleFile, baseFolder, x86: true); + WixAssert.CompareLineByLine(new[] + { + "Loading .NET Core FDD bootstrapper application.", + "Creating BA thread to run asynchronously.", + "LatestCoreBA", + "Shutdown,ReloadBootstrapper,0", + }, result.Output.ToArray()); + } + } + [Fact] public void CanReloadFDDLatestCoreMBA() { diff --git a/src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngine.cs b/src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngine.cs index 4df52e87..0ca2b40f 100644 --- a/src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngine.cs +++ b/src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngine.cs @@ -12,18 +12,19 @@ namespace WixToolsetTest.ManagedHost public class TestEngine { private static readonly string TestEngineFile = TestData.Get(@"..\x64\examples\Example.TestEngine\Example.TestEngine.exe"); + private static readonly string TestEngineFileX86 = TestData.Get(@"..\x86\examples\Example.TestEngine\Example.TestEngine.exe"); - public TestEngineResult RunReloadEngine(string bundleFilePath, string tempFolderPath) + public TestEngineResult RunReloadEngine(string bundleFilePath, string tempFolderPath, bool x86 = false) { - return this.RunTestEngine("reload", bundleFilePath, tempFolderPath); + return this.RunTestEngine("reload", bundleFilePath, tempFolderPath, x86); } - public TestEngineResult RunShutdownEngine(string bundleFilePath, string tempFolderPath) + public TestEngineResult RunShutdownEngine(string bundleFilePath, string tempFolderPath, bool x86 = false) { - return this.RunTestEngine("shutdown", bundleFilePath, tempFolderPath); + return this.RunTestEngine("shutdown", bundleFilePath, tempFolderPath, x86); } - private TestEngineResult RunTestEngine(string engineMode, string bundleFilePath, string tempFolderPath) + private TestEngineResult RunTestEngine(string engineMode, string bundleFilePath, string tempFolderPath, bool x86 = false) { var baFolderPath = Path.Combine(tempFolderPath, "ba"); var extractFolderPath = Path.Combine(tempFolderPath, "extract"); @@ -35,7 +36,7 @@ namespace WixToolsetTest.ManagedHost '"' + bundleFilePath + '"', '"' + extractResult.GetBAFilePath(baFolderPath) + '"', }; - return RunProcessCaptureOutput(TestEngineFile, args); + return RunProcessCaptureOutput(x86 ? TestEngineFileX86 : TestEngineFile, args); } private static TestEngineResult RunProcessCaptureOutput(string executablePath, string[] arguments = null, string workingFolder = null) diff --git a/src/ext/Bal/test/WixToolsetTest.ManagedHost/WixToolsetTest.ManagedHost.csproj b/src/ext/Bal/test/WixToolsetTest.ManagedHost/WixToolsetTest.ManagedHost.csproj index 16dbec94..a55beac7 100644 --- a/src/ext/Bal/test/WixToolsetTest.ManagedHost/WixToolsetTest.ManagedHost.csproj +++ b/src/ext/Bal/test/WixToolsetTest.ManagedHost/WixToolsetTest.ManagedHost.csproj @@ -1,4 +1,4 @@ - + diff --git a/src/ext/Bal/test/examples/EarliestCoreBundleFDDx86/EarliestCoreBundleFDDx86.wixproj b/src/ext/Bal/test/examples/EarliestCoreBundleFDDx86/EarliestCoreBundleFDDx86.wixproj new file mode 100644 index 00000000..470ee042 --- /dev/null +++ b/src/ext/Bal/test/examples/EarliestCoreBundleFDDx86/EarliestCoreBundleFDDx86.wixproj @@ -0,0 +1,6 @@ + + + + x86 + + diff --git a/src/ext/Bal/test/examples/EarliestCoreBundleFDDx86/FrameworkDependentBundle.wxs b/src/ext/Bal/test/examples/EarliestCoreBundleFDDx86/FrameworkDependentBundle.wxs new file mode 100644 index 00000000..3672fc1d --- /dev/null +++ b/src/ext/Bal/test/examples/EarliestCoreBundleFDDx86/FrameworkDependentBundle.wxs @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/ext/Bal/test/examples/LatestCoreBundleFDDx86/FrameworkDependentBundle.wxs b/src/ext/Bal/test/examples/LatestCoreBundleFDDx86/FrameworkDependentBundle.wxs new file mode 100644 index 00000000..15dd290a --- /dev/null +++ b/src/ext/Bal/test/examples/LatestCoreBundleFDDx86/FrameworkDependentBundle.wxs @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/ext/Bal/test/examples/LatestCoreBundleFDDx86/LatestCoreBundleFDDx86.wixproj b/src/ext/Bal/test/examples/LatestCoreBundleFDDx86/LatestCoreBundleFDDx86.wixproj new file mode 100644 index 00000000..470ee042 --- /dev/null +++ b/src/ext/Bal/test/examples/LatestCoreBundleFDDx86/LatestCoreBundleFDDx86.wixproj @@ -0,0 +1,6 @@ + + + + x86 + + diff --git a/src/ext/Bal/test/examples/examples.proj b/src/ext/Bal/test/examples/examples.proj index 20d4ecd5..82a5e3c1 100644 --- a/src/ext/Bal/test/examples/examples.proj +++ b/src/ext/Bal/test/examples/examples.proj @@ -25,6 +25,7 @@ $(MBAPublishPath)Example.WPFCoreMBA + true true @@ -35,6 +36,8 @@ +