microsoft / microsoft/msix-packaging

[BUG] Cannot even build pipeline for WPF / .NET 6 solution

Open
#534 0 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-MSIX ADO Bug
Dominant language
C
Stars
1.1k
Forks
193
Avg merge
2h 16m
Merged PRs (30d)
2

Description

Project
MSIX Packaging Azure extension

Describe the bug
I used Visual Studio 2022 with latest .Net 6 stable version to create a solution containing a simple WPF project with another MSIX packaging project.
I created a repository on Azure DevOps for this solution and created a build pipeline using the MSIX Build And Package extension as explained in the documentation.
When pipeline is running, it cannot build the solution because even using a windows-latest agent and indicating latest in msbuildVersion parameter. It doesn't recognize project files format.

image

When looking at the output of the extension, we can see it is not using the latest version of msbuild and msbuildVersion is limited to version 16. Which is not enough for building .NET 6 application.

When I try to reproduce what does the extension using MSBuild extension, I can go further but it fails during compilation with error message below.

image

[error]C:\hostedtoolcache\windows\dotnet\sdk\6.0.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(267,5): Error NETSDK1004: Assets file 'D:\a\1\s\Test.Wpf\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.

Here is the pipeline YAML used to build the solution with the MSIX packaging extension:

name: '$(Build.DefinitionName)_$(Build.SourceBranchName)_$(Date:yyyy.M.d).$(Rev:r)'

trigger:
- '*'

pool:
  vmImage: windows-latest

steps:

- task: VersionDotNetCoreAssemblies@2
  inputs:
    Path: '$(Build.SourcesDirectory)'
    VersionNumber: '$(Build.BuildNumber)'
    Injectversion: False
    VersionRegex: '\d+\.\d+\.\d+\.\d+'
    FilenamePattern: '.csproj'
    AddDefault: true
    OutputVersion: 'AppVersion'

- task: UseDotNet@2
  inputs:
    packageType: 'sdk'
    version: '6.x'

- task: MsixPackaging@1
  inputs:
    outputPath: '$(Build.ArtifactStagingDirectory)'
    solution: '**/*.sln'
    clean: false
    generateBundle: false
    buildConfiguration: 'release'
    buildPlatform: 'Any CPU'
    updateAppVersion: true
    manifestFile: 'Test.Msix/Package.appxmanifest'
    appVersion: '$(Date:yyyy.M.d).$(Rev:r)'
    appPackageDistributionMode: 'SideloadOnly'
    msbuildLocationMethod: 'version'
    msbuildVersion: 'latest'
    msbuildArchitecture: 'x64'

And here is the one used to build the solution using VSBuild extension:

name: '$(Build.DefinitionName)_$(Build.SourceBranchName)_$(Date:yyyy.M.d).$(Rev:r)'

trigger:
- '*'

pool:
  vmImage: windows-latest

steps:

- task: VersionDotNetCoreAssemblies@2
  inputs:
    Path: '$(Build.SourcesDirectory)'
    VersionNumber: '$(Build.BuildNumber)'
    Injectversion: False
    VersionRegex: '\d+\.\d+\.\d+\.\d+'
    FilenamePattern: '.csproj'
    AddDefault: true
    OutputVersion: 'AppVersion'

- task: UseDotNet@2
  inputs:
    packageType: 'sdk'
    version: '6.x'

- task: VSBuild@1
  inputs:
    solution: '**\*.sln'
    msbuildArgs: '/p:UapAppxPackageBuildMode=SideloadOnly /p:AppxPackageSigningEnabled=false /p:AppxBundle=Never /p:AppxPackageOutput=$(Build.ArtifactStagingDirectory)'
    configuration: 'Release'
    platform: 'Any CPU'
    msbuildArchitecture: 'x64'
    logProjectEvents: false

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two YAML pipelines using the MsixPackaging@1 and VSBuild@1 tasks on a windows-latest agent with the .NET 6 WPF solution. Compare the selected MSBuild version and the NuGet restore behavior; done means the MSIX packaging pipeline can build the solution without the project-format or missing project.assets.json errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
build-system, ci-cd, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.