Upgrade dnchost's nethost dependency to .NET 6.0.4.
Sean Hall committed
Apr 20, 2022 at 15:30 UTC
b82c6a2b7d451212fb0b2e32ca4d5d86c953d81a
13 files changed
+115
-14
src/ext/Bal/bal.cmd
+4
@@ -22,6 +22,10 @@ msbuild -p:Configuration=%_C%;Platform=x86 mbahost\mbahost.vcxproj || exit /b
22
msbuild -p:Configuration=%_C%;Platform=x64 mbahost\mbahost.vcxproj || exit /b
23
msbuild -p:Configuration=%_C%;Platform=ARM64 mbahost\mbahost.vcxproj || exit /b
24
25
+msbuild -p:Configuration=%_C%;Platform=x86 test\examples\TestEngine\Example.TestEngine.vcxproj || exit /b
26
+msbuild -p:Configuration=%_C%;Platform=x64 test\examples\TestEngine\Example.TestEngine.vcxproj || exit /b
27
+msbuild -p:Configuration=%_C%;Platform=ARM64 test\examples\TestEngine\Example.TestEngine.vcxproj || exit /b
28
+
29
msbuild -p:Configuration=%_C% || exit /b
30
31
dotnet test test\WixToolsetTest.Dnc.HostGenerator -c %_C% --nologo --no-build -l "trx;LogFileName=%_L%\TestResults\WixToolsetTest.Dnc.HostGenerator.trx" || exit /b
src/ext/Bal/dnchost/dnchost.vcxproj
+1
-1
@@ -49,7 +49,7 @@
49
<PropertyGroup>
50
<NetHostPlatform>$(Platform)</NetHostPlatform>
51
<NetHostPlatform Condition=" '$(NetHostPlatform)'=='Win32' ">x86</NetHostPlatform>
52
- <NetHostPath>..\..\..\..\packages\runtime.win-$(NetHostPlatform).Microsoft.NETCore.DotNetAppHost.5.0.0\runtimes\win-$(NetHostPlatform)\native\</NetHostPath>
52
+ <NetHostPath>..\..\..\..\packages\runtime.win-$(NetHostPlatform).Microsoft.NETCore.DotNetAppHost.6.0.4\runtimes\win-$(NetHostPlatform)\native\</NetHostPath>
53
<ProjectAdditionalIncludeDirectories>$(BaseOutputPath)obj;$(NetHostPath)</ProjectAdditionalIncludeDirectories>
54
<ProjectAdditionalLinkLibraries>shlwapi.lib;$(NetHostPath)libnethost.lib</ProjectAdditionalLinkLibraries>
55
</PropertyGroup>
src/ext/Bal/dnchost/packages.config
+3
-3
@@ -1,6 +1,6 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<packages>
3
- <package id="runtime.win-arm64.Microsoft.NETCore.DotNetAppHost" version="5.0.0" targetFramework="native" />
4
- <package id="runtime.win-x64.Microsoft.NETCore.DotNetAppHost" version="5.0.0" targetFramework="native" />
5
- <package id="runtime.win-x86.Microsoft.NETCore.DotNetAppHost" version="5.0.0" targetFramework="native" />
3
+ <package id="runtime.win-arm64.Microsoft.NETCore.DotNetAppHost" version="6.0.4" targetFramework="native" />
4
+ <package id="runtime.win-x64.Microsoft.NETCore.DotNetAppHost" version="6.0.4" targetFramework="native" />
5
+ <package id="runtime.win-x86.Microsoft.NETCore.DotNetAppHost" version="6.0.4" targetFramework="native" />
6
</packages>
\ No newline at end of file
src/ext/Bal/test/WixToolsetTest.ManagedHost/DncHostFixture.cs
+47
@@ -2,6 +2,7 @@
2
3
namespace WixToolsetTest.ManagedHost
4
{
5
+ using System;
6
using WixBuildTools.TestSupport;
7
using Xunit;
8
@@ -29,6 +30,29 @@ namespace WixToolsetTest.ManagedHost
30
}
31
}
32
33
+ [Fact(Skip = "Requires .NET Core 3.1 x86 runtime which might be missing")]
34
+ public void CanLoadFDDx86EarliestCoreMBA()
35
+ {
36
+ // https://github.com/microsoft/vstest/issues/3586
37
+ Environment.SetEnvironmentVariable("DOTNET_ROOT", null);
38
+
39
+ using (var fs = new DisposableFileSystem())
40
+ {
41
+ var baseFolder = fs.GetFolder();
42
+ var bundleFile = TestData.Get(bundleBasePath, "EarliestCoreBundleFDDx86.exe");
43
+ var testEngine = new TestEngine();
44
+
45
+ var result = testEngine.RunShutdownEngine(bundleFile, baseFolder, x86: true);
46
+ WixAssert.CompareLineByLine(new[]
47
+ {
48
+ "Loading .NET Core FDD bootstrapper application.",
49
+ "Creating BA thread to run asynchronously.",
50
+ "EarliestCoreBA",
51
+ "Shutdown,ReloadBootstrapper,0",
52
+ }, result.Output.ToArray());
53
+ }
54
+ }
55
+
56
[Fact]
57
public void CanLoadSCDEarliestCoreMBA()
58
{
@@ -115,6 +139,29 @@ namespace WixToolsetTest.ManagedHost
139
}
140
}
141
142
+ [Fact]
143
+ public void CanLoadFDDx86LatestCoreMBA()
144
+ {
145
+ // https://github.com/microsoft/vstest/issues/3586
146
+ Environment.SetEnvironmentVariable("DOTNET_ROOT", null);
147
+
148
+ using (var fs = new DisposableFileSystem())
149
+ {
150
+ var baseFolder = fs.GetFolder();
151
+ var bundleFile = TestData.Get(bundleBasePath, "LatestCoreBundleFDDx86.exe");
152
+ var testEngine = new TestEngine();
153
+
154
+ var result = testEngine.RunShutdownEngine(bundleFile, baseFolder, x86: true);
155
+ WixAssert.CompareLineByLine(new[]
156
+ {
157
+ "Loading .NET Core FDD bootstrapper application.",
158
+ "Creating BA thread to run asynchronously.",
159
+ "LatestCoreBA",
160
+ "Shutdown,ReloadBootstrapper,0",
161
+ }, result.Output.ToArray());
162
+ }
163
+ }
164
+
165
[Fact]
166
public void CanReloadFDDLatestCoreMBA()
167
{
src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngine.cs
+7
-6
@@ -12,18 +12,19 @@ namespace WixToolsetTest.ManagedHost
12
public class TestEngine
13
{
14
private static readonly string TestEngineFile = TestData.Get(@"..\x64\examples\Example.TestEngine\Example.TestEngine.exe");
15
+ private static readonly string TestEngineFileX86 = TestData.Get(@"..\x86\examples\Example.TestEngine\Example.TestEngine.exe");
16
16
- public TestEngineResult RunReloadEngine(string bundleFilePath, string tempFolderPath)
17
+ public TestEngineResult RunReloadEngine(string bundleFilePath, string tempFolderPath, bool x86 = false)
18
{
18
- return this.RunTestEngine("reload", bundleFilePath, tempFolderPath);
19
+ return this.RunTestEngine("reload", bundleFilePath, tempFolderPath, x86);
20
}
21
21
- public TestEngineResult RunShutdownEngine(string bundleFilePath, string tempFolderPath)
22
+ public TestEngineResult RunShutdownEngine(string bundleFilePath, string tempFolderPath, bool x86 = false)
23
{
23
- return this.RunTestEngine("shutdown", bundleFilePath, tempFolderPath);
24
+ return this.RunTestEngine("shutdown", bundleFilePath, tempFolderPath, x86);
25
}
26
26
- private TestEngineResult RunTestEngine(string engineMode, string bundleFilePath, string tempFolderPath)
27
+ private TestEngineResult RunTestEngine(string engineMode, string bundleFilePath, string tempFolderPath, bool x86 = false)
28
{
29
var baFolderPath = Path.Combine(tempFolderPath, "ba");
30
var extractFolderPath = Path.Combine(tempFolderPath, "extract");
@@ -35,7 +36,7 @@ namespace WixToolsetTest.ManagedHost
36
'"' + bundleFilePath + '"',
37
'"' + extractResult.GetBAFilePath(baFolderPath) + '"',
38
};
38
- return RunProcessCaptureOutput(TestEngineFile, args);
39
+ return RunProcessCaptureOutput(x86 ? TestEngineFileX86 : TestEngineFile, args);
40
}
41
42
private static TestEngineResult RunProcessCaptureOutput(string executablePath, string[] arguments = null, string workingFolder = null)
src/ext/Bal/test/WixToolsetTest.ManagedHost/WixToolsetTest.ManagedHost.csproj
+1
-1
@@ -1,4 +1,4 @@
1
-<?xml version="1.0" encoding="utf-8"?>
1
+<?xml version="1.0" encoding="utf-8"?>
2
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4
<Project Sdk="Microsoft.NET.Sdk">
src/ext/Bal/test/examples/EarliestCoreBundleFDDx86/EarliestCoreBundleFDDx86.wixproj
new
+6
@@ -0,0 +1,6 @@
1
+<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2
+<Project Sdk="WixToolset.Sdk">
3
+ <PropertyGroup>
4
+ <InstallerPlatform>x86</InstallerPlatform>
5
+ </PropertyGroup>
6
+</Project>
src/ext/Bal/test/examples/EarliestCoreBundleFDDx86/FrameworkDependentBundle.wxs
new
+15
@@ -0,0 +1,15 @@
1
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
2
+ <Bundle Name="FDDx86EarliestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="{3D4A29A0-8AAE-4831-A9CF-E34AC298097D}">
3
+ <BootstrapperApplication>
4
+ <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd-x86\Example.EarliestCoreMBA.deps.json" Name="Example.EarliestCoreMBA.deps.json" />
5
+ <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd-x86\Example.EarliestCoreMBA.dll" Name="Example.EarliestCoreMBA.dll" bal:BAFactoryAssembly="yes" />
6
+ <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd-x86\Example.EarliestCoreMBA.runtimeconfig.json" Name="Example.EarliestCoreMBA.runtimeconfig.json" />
7
+ <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd-x86\mbanative.dll" Name="mbanative.dll" />
8
+ <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd-x86\WixToolset.Mba.Core.dll" Name="WixToolset.Mba.Core.dll" />
9
+ <bal:WixDotNetCoreBootstrapperApplicationHost />
10
+ </BootstrapperApplication>
11
+ <Chain>
12
+ <ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" bal:PrereqPackage="yes" />
13
+ </Chain>
14
+ </Bundle>
15
+</Wix>
src/ext/Bal/test/examples/LatestCoreBundleFDDx86/FrameworkDependentBundle.wxs
new
+15
@@ -0,0 +1,15 @@
1
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
2
+ <Bundle Name="FDDx86LatestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="{E547C546-5E0E-4BF9-A675-BBEF4C77FF0D}">
3
+ <BootstrapperApplication>
4
+ <Payload SourceFile="publish\Example.LatestCoreMBA\fdd-x86\Example.LatestCoreMBA.deps.json" Name="Example.LatestCoreMBA.deps.json" />
5
+ <Payload SourceFile="publish\Example.LatestCoreMBA\fdd-x86\Example.LatestCoreMBA.dll" Name="Example.LatestCoreMBA.dll" bal:BAFactoryAssembly="yes" />
6
+ <Payload SourceFile="publish\Example.LatestCoreMBA\fdd-x86\Example.LatestCoreMBA.runtimeconfig.json" Name="Example.LatestCoreMBA.runtimeconfig.json" />
7
+ <Payload SourceFile="publish\Example.LatestCoreMBA\fdd-x86\mbanative.dll" Name="mbanative.dll" />
8
+ <Payload SourceFile="publish\Example.LatestCoreMBA\fdd-x86\WixToolset.Mba.Core.dll" Name="WixToolset.Mba.Core.dll" />
9
+ <bal:WixDotNetCoreBootstrapperApplicationHost />
10
+ </BootstrapperApplication>
11
+ <Chain>
12
+ <ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" bal:PrereqPackage="yes" />
13
+ </Chain>
14
+ </Bundle>
15
+</Wix>
src/ext/Bal/test/examples/LatestCoreBundleFDDx86/LatestCoreBundleFDDx86.wixproj
new
+6
@@ -0,0 +1,6 @@
1
+<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2
+<Project Sdk="WixToolset.Sdk">
3
+ <PropertyGroup>
4
+ <InstallerPlatform>x86</InstallerPlatform>
5
+ </PropertyGroup>
6
+</Project>
src/ext/Bal/test/examples/examples.proj
+3
@@ -25,6 +25,7 @@
25
</CoreMBAProject>
26
<CoreMBAProject Include="$(WPFCoreMBAProjectPath)">
27
<PublishPath>$(MBAPublishPath)Example.WPFCoreMBA</PublishPath>
28
+ <SkipFDDx86>true</SkipFDDx86>
29
<SkipSCD>true</SkipSCD>
30
</CoreMBAProject>
31
@@ -35,6 +36,8 @@
36
</ItemGroup>
37
38
<Target Name="PublishCoreExamples">
39
+ <Exec Command='dotnet publish -o "%(CoreMBAProject.PublishPath)\fdd-x86" -r win-x86 -c $(Configuration) --self-contained false "%(CoreMBAProject.Identity)"'
40
+ Condition="'%(CoreMBAProject.SkipFDDx86)'==''" />
41
<Exec Command='dotnet publish -o "%(CoreMBAProject.PublishPath)\fdd" -r win-x64 -c $(Configuration) --self-contained false "%(CoreMBAProject.Identity)"'
42
Condition="'%(CoreMBAProject.SkipFDD)'==''" />
43
<Exec Command='dotnet publish -o "%(CoreMBAProject.PublishPath)\scd" -r win-x64 -c $(Configuration) --self-contained true "%(CoreMBAProject.Identity)"'
src/test/burn/README.md
+2
-2
@@ -20,9 +20,9 @@ For example, the following line runs only the specified test:
20
> dotnet test --filter WixToolsetTest.BurnE2E.BasicFunctionalityTests.CanInstallAndUninstallSimpleBundle_x86_wixstdba WixToolsetTest.BurnE2E.dll
21
22
The VM must have:
23
-1. x64 .NET Core SDK of 5.0 or later (for the test runner)
23
+1. x64 .NET Core SDK of 6.0 or later (for the test runner and .NET Core TestBA)
24
1. Any version of .NET Framework (for the .NET Framework TestBA)
25
-1. x86 .NET Core Desktop Runtime of 5.0 or later (for the .NET Core TestBA)
25
+1. x86 .NET Core Desktop Runtime of 6.0 or later (for the .NET Core TestBA)
26
27
## Building with local changes
28
src/test/burn/WixToolsetTest.BurnE2E/BurnE2ETests.cs
+5
-1
@@ -11,7 +11,11 @@ namespace WixToolsetTest.BurnE2E
11
[Collection("BurnE2E")]
12
public abstract class BurnE2ETests : WixTestBase, IDisposable
13
{
14
- protected BurnE2ETests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
14
+ protected BurnE2ETests(ITestOutputHelper testOutputHelper) : base(testOutputHelper)
15
+ {
16
+ // https://github.com/microsoft/vstest/issues/3586
17
+ Environment.SetEnvironmentVariable("DOTNET_ROOT", null);
18
+ }
19
20
private Stack<IDisposable> Installers { get; } = new Stack<IDisposable>();
21