Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error MSB4062: The "Microsoft.Build.Packaging.Pri.Tasks.ExpandPriContent" #4889

Open
dotMorten opened this issue Nov 15, 2024 · 1 comment
Open
Assignees

Comments

@dotMorten
Copy link
Contributor

dotMorten commented Nov 15, 2024

Describe the bug

Having some class libraries that reference each other, and the head app ends up failing to compile with an unhelpful error:

E:.nuget\packages\microsoft.windowsappsdk\1.6.240923002\buildTransitive\MrtCore.PriGen.targets(914,5): error MSB4062: The "Microsoft.Build.Packaging.Pri.Tasks.ExpandPriContent" task could not be loaded from the assembly C:\Program Files\dotnet\sdk\9.0.100\Microsoft\VisualStudio\v17.0\AppxPackage\Microsoft.Build.Packaging.Pri.Tasks.dll. Could not load file or assembly 'C:\Program Files\dotnet\sdk\9.0.100\Microsoft\VisualStudio\v17.0\AppxPackage\Microsoft.Build.Packaging.Pri.Tasks.dll'. The system cannot find the path specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Reproduced with both .NET 9.0.100 and .NET 8.0.404, so doesn't appear to be a .NET 9 regression. Can also reproduce with both 1.5 and 1.6 of the SDK

The missing file doesn't exist. I wonder if it was supposed to evaluate to: "c:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VisualStudio\v17.0\AppxPackage\Microsoft.Build.Packaging.Pri.Tasks.dll" instead ?

Steps to reproduce the bug

  1. Unzip the following project: winappsdkrepro.zip
  2. Open and compile it. Notice that the MAUI application fails to compile with the above error.

Expected behavior

No response

Screenshots

No response

NuGet package version

Windows App SDK 1.6.2: 1.6.241106002

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022

Additional context

I can also reproduce this from commandline if I use dotnet build. However I don't reproduce from commandline if I use msbuild /restore CalciteDotNet.sln /t:Build, leading me to believe that when compiling from within Visual Studio, it doesn't use msbuild.

@dotMorten
Copy link
Contributor Author

Potentially related to dotnet/maui#5886 @mattleibow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants