Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Controls/tests/ManualTests/Controls.ManualTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<!-- <UseMaui>true</UseMaui> -->
<!-- Uncomment the below line to use the specified .NET MAUI version instead of the version provided by the installed workload -->
<!-- <MauiVersion>9.0.100</MauiVersion> -->
<!-- Uncomment the below lines to use the specified (default new .NET MAUI app) platforms instead of a variable value from externally -->
<!-- <MauiManualTestsPlatforms>net9.0-android;net9.0-ios;net9.0-maccatalyst</MauiManualTestsPlatforms> -->
<!-- <MauiManualTestsPlatforms Condition="$([MSBuild]::IsOSPlatform('windows'))">$(MauiManualTestsPlatforms);net9.0-windows10.0.19041.0</MauiManualTestsPlatforms>-->
<TargetFrameworks>$(MauiManualTestsPlatforms)</TargetFrameworks>
<TargetFrameworks Condition=" '$(UseMaui)' != 'true' and '$(IncludePreviousTfms)' == 'true' ">$(TargetFrameworks);$(MauiManualTestsPreviousPlatforms)</TargetFrameworks>
<OutputType>Exe</OutputType>
Expand Down
13 changes: 12 additions & 1 deletion src/Controls/tests/ManualTests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,21 @@ Navigate to the Microsoft.Maui.Controls package on the nightly feed (or use tool
</ItemGroup>
```

Note: you can also set the values to `$(MauiVersion)` and set a `<MauiVersion>` node with the version you want to use. See **Method 2**, below.

### How to Compile

This mode is similar to Workloads Mode but allows specifying any available NuGet version for `MauiVersion`. It requires setting `UseMaui=true`.

You will need to manually add the target frameworks to the `<TargetFrameworks>` node when you use this method. For example, running the project on iOS and Android will require:

```xml
<!-- Instead of: <TargetFrameworks>$(MauiManualTestsPlatforms)</TargetFrameworks> do the line below -->
<TargetFrameworks>net10.0-ios;net10.0-android</TargetFrameworks>
```

Depending on the .NET version you want to use, replace `net10.0` prefix with the version you want to use, for example: `net9.0`.

#### Method 1: Using MSBuild Property
```bash
dotnet build -p:UseMaui=true -p:MauiVersion=8.0.0-nightly.8832+sha.feb791fc7-azdo.8163102
Expand Down Expand Up @@ -363,4 +374,4 @@ dotnet build
4. **Always restore packages** before building: `dotnet restore`
5. **Keep workloads updated** regularly: `dotnet workload update`
6. **Pin specific versions** in production scenarios
7. **Test across multiple platforms**
7. **Test across multiple platforms**
Loading