'dotnet test' fails on a Windows Application Packaging Project

37 Views Asked by At

I am trying to create a CI/CD pipeline for an existing solution which has MSUnit and WAP projects. It is necessary that build, test, and deploy actions can be triggered via command line, and I am getting stuck at the 'test' part. The error is straightforward to reproduce.

Prerequisites: .NET desktop development, Universal Windows Platform development

  1. Open Visual Studio (I am using Community 2022)
  2. Create a blank solution.
  3. Right click solution->Add->New Project
  4. Windows Application Packaging Project, Next, Create
  5. Target/minimum Windows versions are left at default. OK out.
  6. File->Save All
  7. Open a command line.
  8. cd into the solution directory.
  9. dotnet test

I do not expect this to work, as there are no tests, and the WAP project has no bundled applications. But I do get an error that has nothing to do with these inadequacies: .\Solution1\WapProjTemplate1\WapProjTemplate1.wapproj(55,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\8.0.203\Microsoft\DesktopBridge\Microsoft.DesktopBridge.props" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\sdk\8.0.203\Microsoft\DesktopBridge\Microsoft.DesktopBridge.props" is correct, and that the file exists on disk.

This is the same error I get on the real deal. What's interesting to me is that 'DesktopBridge' exists, but it lives in the Visual Studio folder (MSBuild/Microsoft/DesktopBridge), not the dotnet folder.

1

There are 1 best solutions below

0
Minxin Yu - MSFT On

The .NET CLI is primarily designed for .NET Core and .NET Standard projects.

So it does not support wapproj.