| 1 | <Project Sdk="Microsoft.NET.Sdk"> |
| 2 | |
| 3 | <PropertyGroup> |
| 4 | <OutputType>Exe</OutputType> |
| 5 | <TargetFramework>net8.0-windows10.0.19041.0</TargetFramework> |
| 6 | <Nullable>enable</Nullable> |
| 7 | <ImplicitUsings>enable</ImplicitUsings> |
| 8 | <RootNamespace>WSLCCustomContainer</RootNamespace> |
| 9 | <AssemblyName>qr</AssemblyName> |
| 10 | <!-- The native wslcsdk.dll shipped by the SDK package is architecture |
| 11 | specific, and the package picks which copy to deploy from PlatformTarget. |
| 12 | Default to x64 so a plain `dotnet build` / `dotnet run` works out of the |
| 13 | box. On an ARM64 device build with `dotnet build -p:PlatformTarget=ARM64`. --> |
| 14 | <PlatformTarget Condition="'$(PlatformTarget)' == ''">x64</PlatformTarget> |
| 15 | </PropertyGroup> |
| 16 | |
| 17 | <ItemGroup> |
| 18 | <PackageReference Include="Microsoft.WSL.Containers" Version="2.9.3" /> |
| 19 | </ItemGroup> |
| 20 | |
| 21 | <!-- |
| 22 | Auto-build the custom container image as part of the normal build (F5). |
| 23 | The Microsoft.WSL.Containers package runs `wslc image build` + `wslc image |
| 24 | save` after Build, producing customcontainer.tar next to the executable. |
| 25 | The app loads that local tar at run time (no registry pull). The image step |
| 26 | is incremental: it only re-runs when files under Container\ change. |
| 27 | --> |
| 28 | <ItemGroup> |
| 29 | <WslcImage Include="customcontainer" |
| 30 | Image="customcontainer:latest" |
| 31 | Dockerfile="Container\Containerfile" |
| 32 | Context="Container" |
| 33 | Sources="Container" |
| 34 | TarLocation="$(OutDir)customcontainer.tar" /> |
| 35 | </ItemGroup> |
| 36 | |
| 37 | </Project> |