Skip to content

Commit 4ff08f2

Browse files
fix: override TargetFrameworks to prevent iOS workload errors in CodeQL build
Using -f net9.0-android doesn't prevent MSBuild from evaluating and importing workloads for ALL declared TargetFrameworks (including ios and maccatalyst) during project SDK evaluation. This happens before the framework selector takes effect. Using /p:TargetFrameworks=net9.0-android overrides the property at the command-line level (highest MSBuild priority), so the SDK only sees net9.0-android during evaluation and doesn't try to import unavailable iOS/macCatalyst workloads. Also build only the library project instead of the full solution, since DemoApp code isn't needed for CodeQL security analysis. Agent-Logs-Url: https://github.com/trimble-oss/modus-mobile-maui-components/sessions/bcc76a04-3fd6-4b59-beb1-97abd429b4af Co-authored-by: jeff-at-trimble <215895768+jeff-at-trimble@users.noreply.github.com>
1 parent 3b2c9c1 commit 4ff08f2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
queries: +security-and-quality
5454

5555
- name: Build
56-
run: dotnet build Trimble.Modus.Components.sln -f net9.0-android -c Release
56+
run: dotnet build Trimble.Modus.Components/Trimble.Modus.Components.csproj /p:TargetFrameworks=net9.0-android -c Release
5757

5858
- name: Perform CodeQL Analysis
5959
uses: github/codeql-action/analyze@v4

0 commit comments

Comments
 (0)