diff options
Diffstat (limited to 'src/test/examples/EarliestCoreMBA')
3 files changed, 74 insertions, 0 deletions
diff --git a/src/test/examples/EarliestCoreMBA/EarliestCoreBA.cs b/src/test/examples/EarliestCoreMBA/EarliestCoreBA.cs new file mode 100644 index 00000000..c9291a7f --- /dev/null +++ b/src/test/examples/EarliestCoreMBA/EarliestCoreBA.cs | |||
| @@ -0,0 +1,34 @@ | |||
| 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 | |||
| 3 | namespace Example.EarliestCoreMBA | ||
| 4 | { | ||
| 5 | using WixToolset.Mba.Core; | ||
| 6 | |||
| 7 | public class EarliestCoreBA : BootstrapperApplication | ||
| 8 | { | ||
| 9 | public EarliestCoreBA(IEngine engine) | ||
| 10 | : base(engine) | ||
| 11 | { | ||
| 12 | |||
| 13 | } | ||
| 14 | |||
| 15 | protected override void Run() | ||
| 16 | { | ||
| 17 | } | ||
| 18 | |||
| 19 | protected override void OnStartup(StartupEventArgs args) | ||
| 20 | { | ||
| 21 | base.OnStartup(args); | ||
| 22 | |||
| 23 | this.engine.Log(LogLevel.Standard, nameof(EarliestCoreBA)); | ||
| 24 | } | ||
| 25 | |||
| 26 | protected override void OnShutdown(ShutdownEventArgs args) | ||
| 27 | { | ||
| 28 | base.OnShutdown(args); | ||
| 29 | |||
| 30 | var message = "Shutdown," + args.Action.ToString() + "," + args.HResult.ToString(); | ||
| 31 | this.engine.Log(LogLevel.Standard, message); | ||
| 32 | } | ||
| 33 | } | ||
| 34 | } | ||
diff --git a/src/test/examples/EarliestCoreMBA/EarliestCoreBAFactory.cs b/src/test/examples/EarliestCoreMBA/EarliestCoreBAFactory.cs new file mode 100644 index 00000000..672e17ee --- /dev/null +++ b/src/test/examples/EarliestCoreMBA/EarliestCoreBAFactory.cs | |||
| @@ -0,0 +1,22 @@ | |||
| 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 | |||
| 3 | [assembly: WixToolset.Mba.Core.BootstrapperApplicationFactory(typeof(Example.EarliestCoreMBA.EarliestCoreBAFactory))] | ||
| 4 | namespace Example.EarliestCoreMBA | ||
| 5 | { | ||
| 6 | using WixToolset.Mba.Core; | ||
| 7 | |||
| 8 | public class EarliestCoreBAFactory : BaseBootstrapperApplicationFactory | ||
| 9 | { | ||
| 10 | private static int loadCount = 0; | ||
| 11 | |||
| 12 | protected override IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand) | ||
| 13 | { | ||
| 14 | if (loadCount > 0) | ||
| 15 | { | ||
| 16 | engine.Log(LogLevel.Standard, $"Reloaded {loadCount} time(s)"); | ||
| 17 | } | ||
| 18 | ++loadCount; | ||
| 19 | return new EarliestCoreBA(engine); | ||
| 20 | } | ||
| 21 | } | ||
| 22 | } | ||
diff --git a/src/test/examples/EarliestCoreMBA/Example.EarliestCoreMBA.csproj b/src/test/examples/EarliestCoreMBA/Example.EarliestCoreMBA.csproj new file mode 100644 index 00000000..326633ba --- /dev/null +++ b/src/test/examples/EarliestCoreMBA/Example.EarliestCoreMBA.csproj | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | <Project Sdk="Microsoft.NET.Sdk"> | ||
| 2 | |||
| 3 | <PropertyGroup> | ||
| 4 | <TargetFramework>netcoreapp3.0</TargetFramework> | ||
| 5 | <RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers> | ||
| 6 | <EnableDynamicLoading>true</EnableDynamicLoading> | ||
| 7 | <Description>Earliest .NET Core MBA</Description> | ||
| 8 | </PropertyGroup> | ||
| 9 | |||
| 10 | <ItemGroup> | ||
| 11 | <TrimmerRootAssembly Include="System.Runtime.Loader" /> | ||
| 12 | </ItemGroup> | ||
| 13 | |||
| 14 | <ItemGroup> | ||
| 15 | <PackageReference Include="Nerdbank.GitVersioning" Version="2.1.65" PrivateAssets="all" /> | ||
| 16 | <PackageReference Include="WixToolset.Mba.Core" Version="4.0.19" /> | ||
| 17 | </ItemGroup> | ||
| 18 | </Project> \ No newline at end of file | ||
