github-actions-for-desktop-apps icon indicating copy to clipboard operation
github-actions-for-desktop-apps copied to clipboard

.NET 6 Update

Open LanceMcCarthy opened this issue 2 years ago • 3 comments

There have been a lot of changes since .NET Core 3 for WPF and packaging projects. .NET 5/6 have many improvements and has a different project style and structure.

This enhancement is to migrate the existing .NET Core 3 project type to .NET 5 and use the improved interconnect in Project Reunion (aka Windows App SDK), SDK contracts and CsWinRT.

@edwardskrod These changes have been implemented in the lance/net5-update branch. Can you review for initial approval? If it looks good to you, I will write a new temporary workflow to start CI-CD improvements.

LanceMcCarthy avatar Oct 21 '21 18:10 LanceMcCarthy

Since .NET 6 is being released tomorrow, I have changed the target of this Enhancement to .NET 6 instead of .NET 5.

If someone is looking for a .NET 5 workflow, they can use the same .NET 6 example for guidance.

LanceMcCarthy avatar Nov 08 '21 16:11 LanceMcCarthy

Side Task - Also I should migrate this to a single-project MSIX at the same time. There is no longer a need to have a 2nd "PackageProject" adding complexity to the solution

LanceMcCarthy avatar Nov 09 '21 00:11 LanceMcCarthy

Updates

I'm closing in on wrapping up the migration to .NET 6. Please visit the lance/net6-update branch to follow along.

Code

All projects have been successfully updated to .NET 6! It took a few different migrations as project structure and dependencies were different back in the NETCore 3.x days

Workflows

In order for me to fully complete the workflow updates, I am wait for an update code signing certificate from Microsoft. The one we currently use has expired. In the meantime, I have inserted a temporary self-signed certificate step in the workflow to be a temporary placeholder.

  • CI for .NET 6 is working, see https://github.com/microsoft/github-actions-for-desktop-apps/actions/workflows/ci-net6-temp.yml
  • CD needs a new certificate before it can be used, I do not want to package and distribute packages that are using self-signed certs.

Single-project MSIX

This is not yet possible for WPF projects. Single-project MSIX is only supported for WinUI3/Windows app SDK project types

Technically, you can generate the MSIX with unsupported msbuild command, but you need to manually bundle and sign it. You can find another project that I currently experimenting with this https://github.com/LanceMcCarthy/MediaFileManager/blob/main-dev/.github/workflows/ci_dev.yml

LanceMcCarthy avatar Dec 02 '21 18:12 LanceMcCarthy

Hello. After 2 years is there any plan to implement the code for .NET 6?

mr-j0nes avatar Jan 12 '24 11:01 mr-j0nes

Hi @mr-j0nes Yeah, the demand to convert this to .NET 6/7/8 has been low, particularly since "single-project MSIX" is an option for WPF apps now.

Instead, there is a separate project that shows you how to achieve it. See https://github.com/andrewleader/WindowsAppSDKGallery/blob/main/.github/workflows/dotnet-desktop.yml. Specifically Line 102 has the build & package MSBuild command.

If that doesn't help you, I can revisit this effort and jump right to .NET 8.

LanceMcCarthy avatar Jan 17 '24 15:01 LanceMcCarthy

Thank you very much. This helps. We can close this issue.

mr-j0nes avatar Jan 17 '24 15:01 mr-j0nes

Closed as Not Planned, but can be re-opened with enough interest.

LanceMcCarthy avatar Jan 17 '24 15:01 LanceMcCarthy