I have upgraded an MSIX WPF app to .NET 8 from .NET 7, and it runs fine on my own computer. But when I try to build it in Azure DevOps, I get the errors:
C:\agent\_work\_tool\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(491,5):
Error NETSDK1112: The runtime pack for Microsoft.NETCore.App.Runtime.win-x64 was not downloaded. Try running a NuGet restore with the RuntimeIdentifier 'win-x64'.
C:\agent\_work\_tool\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(491,5): Error NETSDK1112: The runtime pack for Microsoft.WindowsDesktop.App.Runtime.win-x64 was not downloaded. Try running a NuGet restore with the RuntimeIdentifier 'win-x64'.
I get the same error on both my on-premise build server and when using a hosted agent.
I used these tasks to install and verify .NET 8 on the machines:
- task: UseDotNet@2
inputs:
version: '8.x'
- task: PowerShell@2
displayName: 'Check .NET Version and SDKs'
inputs:
targetType: 'inline'
script: |
dotnet --version
dotnet --list-sdks
dotnet --list-runtimes
But it made no difference.
The project file contains this (I have not changed it since .NET 7)
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
I build the project using this task:
trigger:
branches:
include:
- master
stages:
- stage: Build
jobs:
- job: Build
displayName: "Build app and installer"
pool:
vmImage: 'windows-latest'
steps:
- task: VSBuild@1
inputs:
solution: 'TestApp.sln'
vsVersion: 'latest'
platform: 'x64'
configuration: 'Release'
msbuildArchitecture: 'x64'
msbuildArgs: ''
NEW: Minimal repro project: https://github.com/tripleacoder/MSIXTestApp/