Skip to content

Conversation

@jpnurmi
Copy link
Collaborator

@jpnurmi jpnurmi commented Sep 26, 2025

This PR adds an integration test that builds and runs a minimal Sentry .NET app with different .NET SDK and MSBuild versions:

  • .NET 5.0 (MSBuild 16, excluded on macOS)
  • .NET 8.0 (MSBuild 17)
  • .NET 9.0 (MSBuild 17)

.NET 5.0 installation and tests are excluded on macOS because .NET 5.0 does not support ARM64 on macOS. However, the test reproduces the warning reported in #4554 both on Windows and Linux:

image

Once #4554 has been fixed, we could consider TreatWarningsAsErrors=true to prevent new warnings from surfacing in the future.

Close: #4299

#skip-changelog


Note

Adds MSBuild integration tests for .NET 5/8/9 and updates CI to install .NET 5 SDK and libssl1 on Linux, plus packs during MSBuild.

  • CI
    • Install legacy libssl1.1 on Linux via scripts/install-libssl1.sh in ./github/actions/environment.
    • Install .NET 5.0 SDK (excluded on macOS ARM64) alongside existing SDK setup.
    • MSBuild job now runs Restore,Build,Pack and executes integration tests via integration-test/msbuild.Tests.ps1.
  • Integration Tests
    • New integration-test/msbuild.Tests.ps1 builds/runs a console app via MSBuild across net5.0 (when supported), net8.0, and net9.0, validating Sentry capture.
    • Add integration-test/nuget5.config for NuGet 5 (no packageSourceMapping) used with .NET 5.
    • Update integration-test/common.ps1 to use dotnet restore /p:CheckEolTargetFramework=false.
  • Scripts
    • Add scripts/install-libssl1.sh to install openssl1.1-compat (Alpine) or libssl1.1 (Ubuntu).

Written by Cursor Bugbot for commit dc2ddfd. This will update automatically on new commits. Configure here.

@codecov
Copy link

codecov bot commented Sep 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.47%. Comparing base (fc55d48) to head (dc2ddfd).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4569      +/-   ##
==========================================
+ Coverage   73.46%   73.47%   +0.01%     
==========================================
  Files         482      482              
  Lines       17679    17679              
  Branches     3495     3495              
==========================================
+ Hits        12988    12990       +2     
+ Misses       3800     3798       -2     
  Partials      891      891              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpnurmi jpnurmi force-pushed the test/msbuild-net5.0 branch from 567869c to 2beb045 Compare September 26, 2025 14:00
@jpnurmi jpnurmi changed the title test(ci): Visual Studio MSBuild on Windows test(ci): .NET 5.0 with MSBuild 16 Sep 28, 2025
@jpnurmi jpnurmi marked this pull request as ready for review September 28, 2025 19:01
cursor[bot]

This comment was marked as outdated.

@jpnurmi
Copy link
Collaborator Author

jpnurmi commented Sep 29, 2025

@Flash0ver Turns out we didn't need microsoft/setup-msbuild nor choco install visualstudio2019buildtools for this.

On the contrary, injecting MSBuild 16 into PATH would break the dotnet (9) command that we need to be able to execute for some preparational steps in the integration tests with global.json in the project root.

Fortunately, the same warning can be produced with dotnet msbuild with .NET 5.0 and MSBuild 16 installed on the side.

Copy link
Member

@Flash0ver Flash0ver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is Amazing.MaxValue! It will give us more coverage and confidence when making changes to non-/lib/ Assets, like /build/(*.props|.targets) and /analyzers/* (Compiler Extensions like Source Generators) 🥔

cursor[bot]

This comment was marked as outdated.

Copy link
Member

@Flash0ver Flash0ver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!

  • no more NETSDK1138 on .NET 5 reported
  • but CS8032 reported on .NET 5 SDK, indeed utilizing MSBuild 16.11
image

Got one final (non-blocking) nitpick related to another PR currently in review:

@jpnurmi jpnurmi merged commit e9f75ac into main Sep 30, 2025
33 checks passed
@jpnurmi jpnurmi deleted the test/msbuild-net5.0 branch September 30, 2025 14:00
alexsohn1126 pushed a commit that referenced this pull request Oct 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(ci): Visual Studio MSBuild on Windows

3 participants