microsoft / github-actions-for-desktop-apps

This repo contains a sample WPF application to demonstrate how to create CI/CD pipelines using GitHub Actions.
MIT License
352 stars 109 forks source link

Update CI/CD to fix .NET Core Problem #33

Closed LanceMcCarthy closed 4 years ago

LanceMcCarthy commented 4 years ago

Fixes WAP project build after there was an update for the VMs that Actions runs agents on.

Note: The checks for this PR will fail with error : Certificate could not be opened: GitHubActionsDemo.pfx. It appears to happen because PRs do not have access to GitHub secrets (where the base64 for the cert is).

LanceMcCarthy commented 4 years ago

GitHub actions updated the Windows-latest VM to use Visual Studio 16.2.2, which uses .NET Core 3.1.2.

This had a side effect of breaking any GitHub Actions that load a version of .NET Core older than 3.1.2. The WAP/UWP project build step will fail with the following error

Error MSB4057: The target "ComputeFilesCopiedToPublishDir" does not exist in the project.

because ComputeFilesCopiedToPublishDir was added to the .NET SDK targets in 3.1.2

Solution

The fix to this is to set the .NET core to use 3.1.2 or later. To be safer, use 3.1.x

Verification

To validate that the change from 3.1.100 to 3.1.x fixes the issues, you can review my workflows that just completed a build fixed by this change https://github.com/LanceMcCarthy/MediaFileManager/runs/950493041?check_suite_focus=true