Skip to content

Bootstrapper Project

Richard Martin edited this page Mar 25, 2024 · 2 revisions

Bootstrapper.csproj (.NET Framework) || (.NET Core)

Note in the first line of this file that it's an SDK project using Microsoft.NET.Sdk.

Platform and Target Framework

Looking at the first PropertyGroup, you'll find properties which specify the platform supported and the targeted framework used. The platform matches the architecture specified in Bundle.wixproj.

<Platforms>x64</Platforms>

Additional SDKs

Additional properties pull in SDKs for both WinForms and WPF. When building a WPF-based UI, you'll need both because a window handle will be needed. WPF doesn't provide this, but by including WinForms, you can get a handle for a WPF Window.

<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>

.NET Framework

When targeting .NET Framework, it's best to choose the lowest framework version you have access to in order to avoid deployment issues when end users run your bundle.

<TargetFramework>net462</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>

.NET Framework NuGet Package References

You'll find a reference to a single NuGet package. This provides all the WiX tools we'll be using.

<ItemGroup>
    <PackageReference Include="WixToolset.Mba.Core" Version="4.*" />
</ItemGroup>

.NET Core

When the BA is built upon .NET Core, it's up to your discretion which version you target, but the target must specify the Windows OS with the -windows moniker.

<TargetFramework>net8.0-windows</TargetFramework>

Note

There's a large ItemGroup referencing the source from the .NET Framework solution. The source for the .NET Core BA is identical to the Framework's BA, so this project just references the source files instead of duplicating them.

.NET Core NuGet Package References

.NET Core not only needs a reference to the basic WiX tools in the WixToolset.Mba.Core package, but also requires the .NET Core bootstrapper app host generator, WixToolset.Dnc.HostGenerator.

<ItemGroup>
    <PackageReference Include="WixToolset.Dnc.HostGenerator" Version="4.*" />
    <PackageReference Include="WixToolset.Mba.Core" Version="4.*" />
</ItemGroup>

Back: Solution Overview