Skip to content

Multi-target for .NET Framework 4.8 + .NET 8, 9 and 10 - #7

Merged
DavidRieman merged 2 commits into
DavidRieman:mainfrom
luttje:dotnet-version-upgrade-net9
May 2, 2026
Merged

DavidRieman merged 2 commits into
DavidRieman:mainfrom
luttje:dotnet-version-upgrade-net9

Conversation

@luttje

@luttje luttje commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Hi again, hope you're well.

For our project we're looking to update to .NET 9 (and beyond). Since we rely on SimWinGamePad, it would be super helpful if that supported .NET 8, 9 and 10.

This PR updates to the new SDK-style .csproj format and adds multi-targeting across the three library projects (SimWinKeyboard, SimWinMouse, SimWinGamePad), so a single NuGet package covers all of:

  • net48: existing .NET Framework users are unaffected (I tested this)
  • net8.0-windows: .NET 8 LTS [source]
  • net9.0-windows: .NET 9 STS (I tested this)
  • net10.0-windows: .NET 10 LTS

The SimExamples WPF app targets net9.0-windows as a single-target executable. (I tested this)

What changed:

  • All .csproj files converted from legacy MSBuild format to modern SDK-style (much shorter and easier to maintain)
  • Framework assembly references (System, System.Windows.Forms, etc.) removed. These are automatically included by the SDK.
  • UseWindowsForms=true set on Mouse and GamePad (which use MouseButtons, MessageBox, etc.)
  • UseWPF=true set on SimExamples
  • No changes to any source .cs files. Everything still compiles cleanly across all four targets

All projects build with Build succeeded (the only output is a handful of CA1416 platform-guard warnings on Windows-only APIs, which is expected and fine for this Windows-only input simulation library).

Let me know if I need to adjust anything.

Thanks for maintaining this library!

@luttje luttje mentioned this pull request Mar 24, 2026
2 tasks
@DavidRieman

Copy link
Copy Markdown
Owner

Neat! Sorry I did not see this coming in, as my GitHub Notifications system is often not working well. I was just now working on updating dependency chains anyway when I noticed this. I hope to get this fully reviewed, tested, and merged this weekend.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR converts the repository’s legacy C# project files to SDK-style projects and expands the three reusable input libraries to multi-target modern Windows TFMs alongside .NET Framework. It fits the codebase by modernizing build configuration for the existing SimWinMouse, SimWinKeyboard, SimWinGamePad libraries and the SimExamples sample app.

Changes:

  • Convert all four projects from legacy MSBuild .csproj format to SDK-style projects.
  • Multi-target the three library projects for net48, net8.0-windows, net9.0-windows, and net10.0-windows.
  • Retarget the WPF sample app to net9.0-windows and simplify its project references.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
SimWinMouse/SimWinMouse.csproj Converts the mouse library project to SDK-style and adds multi-target Windows TFMs.
SimWinKeyboard/SimWinKeyboard.csproj Converts the keyboard library project to SDK-style and adds multi-target Windows TFMs.
SimWinGamePad/SimWinGamePad.csproj Converts the gamepad library project to SDK-style, adds multi-targeting, and preserves embedded resource setup.
SimExamples/SimExamples.csproj Converts the sample WPF app to SDK-style, retargets it to net9.0-windows, and simplifies project references.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SimWinMouse</RootNamespace>
<TargetFrameworks>net48;net8.0-windows;net9.0-windows;net10.0-windows</TargetFrameworks>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SimWinKeyboard</RootNamespace>
<TargetFrameworks>net48;net8.0-windows;net9.0-windows;net10.0-windows</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<UseWPF>true</UseWPF>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<UseWindowsForms>true</UseWindowsForms>
<RootNamespace>SimWinKeyboard</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<UseWindowsForms>true</UseWindowsForms>
@DavidRieman

DavidRieman commented May 2, 2026 •

Copy link
Copy Markdown
Owner

Copilot is wrong about some of this. Pulled the forked branch locally and was building and working so I'm going to merge and finesse whichever of the comments actually make sense, tune it up, and prep for new NuGet uploads.

Thanks for your contribution! I've also seen that Key2Joy links my project in a nice way, and I really appreciate that!

@DavidRieman
DavidRieman merged commit a74464f into DavidRieman:main May 2, 2026
4 checks passed
@luttje

luttje commented May 2, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for merging and thanks for maintaining this project, much appreciated!

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.

3 participants