Upgrade targets to .NET 8/.NET 10, refresh MQTTnet packages, and add GitHub Actions CI/publish workflows#18
Merged
Conversation
Agent-Logs-Url: https://github.com/IoTSharp/MQTTnet.AspNetCore.Routing/sessions/b5fea25c-871c-49e5-a60a-6b230d5586de Co-authored-by: maikebing <3445167+maikebing@users.noreply.github.com>
Agent-Logs-Url: https://github.com/IoTSharp/MQTTnet.AspNetCore.Routing/sessions/b5fea25c-871c-49e5-a60a-6b230d5586de Co-authored-by: maikebing <3445167+maikebing@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
maikebing
April 18, 2026 10:26
View session
There was a problem hiding this comment.
Pull request overview
Updates the library and its companion projects to newer .NET target frameworks, refreshes MQTTnet dependencies, and introduces first-party GitHub Actions workflows for CI and package publishing.
Changes:
- Retarget projects to
net8.0/net10.0(library multi-targeted; examples/tests moved tonet10.0). - Update MQTTnet package references to the
5.1.*line and includeREADME.mdin NuGet package metadata. - Add GitHub Actions
CIandPublishworkflows and replace the AppVeyor badge with a GitHub Actions badge.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/MQTTnet.AspNetCore.Routing.Tests/MQTTnet.AspNetCore.Routing.Tests.csproj | Retarget tests to net10.0. |
| Source/Routing/MqttRouter.cs | Tighten null handling and improve error messages during handler invocation/parameter assignment. |
| Source/MQTTnet.AspNetCore.Routing.csproj | Switch TFMs to net8.0;net10.0, float MQTTnet deps to 5.1.*, and pack README. |
| Source/Extensions/ServiceCollectionExtensions.cs | Enable nullable context and harden assembly discovery fallback. |
| README.md | Swap build badge to GitHub Actions and update supported framework list. |
| ExampleServer/ExampleServer.csproj | Retarget example server to net10.0. |
| ExampleClient/ExampleClient.csproj | Retarget example client to net10.0 and float MQTTnet dependency. |
| .github/workflows/publish.yml | Add release/manual publish workflow (build/test/pack/push). |
| .github/workflows/ci.yml | Add CI workflow for restore/build/test on pushes and PRs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+40
to
+41
| <PackageReference Include="MQTTnet" Version="5.1.*" /> | ||
| <PackageReference Include="MQTTnet.AspNetCore" Version="5.1.*" /> |
| @@ -49,7 +51,7 @@ public static IServiceCollection AddMqttControllers(this IServiceCollection serv | |||
| { | |||
| throw new ArgumentException("'fromAssemblies' cannot be an empty array. Pass null or a collection of 1 or more assemblies.", nameof(fromAssemblies)); | |||
| } | |||
| - name: Publish to GitHub Packages | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: dotnet nuget push "${{ github.workspace }}/artifacts/*.nupkg" --api-key "$GITHUB_TOKEN" --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate |
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="MQTTnet" Version="5.0.1.1416" /> | ||
| <PackageReference Include="MQTTnet" Version="5.1.*" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates the library to target
.NET 8and.NET 10, moves the examples/tests to.NET 10, upgrades MQTTnet dependencies to the latest5.1.*line, and replaces the existing external build badge with repository-native GitHub Actions. It also adds first-party CI and release workflows for branch/PR validation and package publishing to both NuGet.org and GitHub Packages.Framework and package baseline
net9.0;net8.0tonet8.0;net10.0ExampleClient,ExampleServer, and test project targets tonet10.05.1.*patch versionsWarning cleanup
GitHub Actions
ci.ymlto build on all branch pushes and pull requestspublish.ymlto pack and publish on release or manual dispatchNUGET_API_KEYGITHUB_TOKENDocs and repository metadata
.NET 8and.NET 10Example of the updated package targeting/version policy: