microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.16k stars 1.45k forks source link

Adding a .wapproj file to an existing WPF app breaks solution build in Visual Studio 2022 #2964

Closed pygmypenguin closed 1 year ago

pygmypenguin commented 1 year ago

Brief description of your issue

I have a desktop application that currently builds and run with no issues. It is build primarily on WPF, with a couple older controls in WinForms and one vcxproj that enables directX rendering. This application currently builds and publishes with Visual Studio's msbuild.exe. In order to modernize our deployment, we want to add a Windows Application Packaging project to take advantage of some modern versioning and distribution principles.

After going through the "Add a new project wizard" to add this project, Visual Studio's built-in "build" command fails with Specified EntryPointExe '' was not found in the project outputs. I've seen a few different solutions online about how to "fix" this but none of them have worked, and all of them seem to require going into the .wapproj or Project.appxmanifest and modifying various elements manually. I would rather not do this if possible, since it appears that these two file types are not very well documented.

Steps to reproduce

Expected behavior

The solution builds with no errors

Actual behavior

The solution fails to build with the following output:

Build FAILED.

"C:\git\TesseractXL\TesseractXL.MSIX\TesseractXL.MSIX.wapproj" (default target) (1) ->
(_ConvertItems target) ->
  C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\DesktopBridge\Microsoft.DesktopBridge.targets(744,5): error : Specified EntryPointExe '' was not found in the project outputs. [C:\git\TesseractXL\TesseractXL.MSIX\TesseractXL.MSIX.wapproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:04.20

Environment

Visual Studio version: Microsoft Visual Studio Professional 2022 (64-bit) 17.4.3
Windows OS Build: 19042.2486 
Target Application (TesseractXL.csproj) relevant PropertyGroup:

    <PropertyGroup>
        <OutputType>WinExe</OutputType>
        <TargetFrameworks>net6.0-windows</TargetFrameworks>
        <Nullable>enable</Nullable>
        <UseWPF>true</UseWPF>
        <Company>DRW</Company>
        <Authors />
        <OutputPath>..\Build\$(Configuration)</OutputPath>
        <BaseOutputPath>..\Build</BaseOutputPath>
        <StartupObject>TesseractXL.Program</StartupObject>
        <ApplicationIcon>Tesseract.ico</ApplicationIcon>
        <PlatformTarget>x64</PlatformTarget>
        <Platforms>AnyCPU;x64</Platforms>
    </PropertyGroup>

wapproj (TesseractXL.MSIX.wapproj) relevant property groups:

<PropertyGroup>
    <WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
  </PropertyGroup>
  <Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
  <PropertyGroup>
    <ProjectGuid>78051ebc-748e-4f0a-8301-738533d0811e</ProjectGuid>
    <TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
    <TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
    <DefaultLanguage>en-US</DefaultLanguage>
    <AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
    <NoWarn>$(NoWarn);NU1702</NoWarn>
    <EntryPointProjectUniqueName>..\TesseractXL\TesseractXL.csproj</EntryPointProjectUniqueName>
  </PropertyGroup>
denelon commented 1 year ago

@pygmypenguin I don't think this issue has anything to do with WinGet. It appears to be an issue with Visual Studio.

You could try: https://developercommunity.visualstudio.com/VisualStudio/report

pygmypenguin commented 1 year ago

hm you're right, my apologies

denelon commented 1 year ago

No worries. I hope I pointed you in the right direction.