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

Publish Release Configuration with WindowsAppSDKSelfContained failed #10197

Open
Higeneko9 opened this issue Nov 23, 2024 · 0 comments
Open

Publish Release Configuration with WindowsAppSDKSelfContained failed #10197

Higeneko9 opened this issue Nov 23, 2024 · 0 comments
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners

Comments

@Higeneko9
Copy link

Describe the bug

I'm trying to publish a project as a self contained singled exe file (None WindowsPackage) now.
Everything works fine as long as it is the Debug configuration. But it failed with the following error message in the Release configuration.

2>C:\Users\kotoi\.nuget\packages\microsoft.windows.sdk.buildtools\10.0.26100.1742\bin\10.0.26100.0\x64\makepri.exe New -ProjectRoot C:\tmp\proj\App55\ -ConfigXml obj\x64\Release\net9.0-windows10.0.19041.0\win-x64\priconfig.xml -OutputFile C:\tmp\proj\App55\bin\x64\Release\net9.0-windows10.0.19041.0\win-x64\resources.pri -IndexName App55 -Verbose -Overwrite  
2>C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(112,5): Error NETSDK1152: Found multiple publish output files with the same relative path: C:\tmp\proj\App55\obj\x64\Release\net9.0-windows10.0.19041.0\win-x64\MsixContent\resources.pri, C:\tmp\proj\App55\bin\x64\Release\net9.0-windows10.0.19041.0\win-x64\resources.pri.

I spent a bit time to figure out what causes this error message, and it seems like a combination of WindowsAppSDKSelfContained with Release configuration cause of the issue.
It works when I commented out the WindowsAppSDKSelfContiane, but now the application requires WindowsApp runtime...

Steps to reproduce the bug

  1. Open Visual Studio 2022 (17.12.0)
  2. Create a WinUI project "Blank App, Packaged (WinUI 3 in Desktop)"
  3. Modify
  4. Modify "Publish Properties" part of the .csproj file
  5. Add "Release" Configuration element to win-x64.pubxml file
  6. Publish "win-x64.pubxml" from publish screen
  7. Publish failed

.csproj file:

  <!-- Publish Properties -->
  <PropertyGroup>
    <WindowsPackageType>None</WindowsPackageType>
    <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
  </PropertyGroup>

win-x64.pubxml file:

<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <PublishProtocol>FileSystem</PublishProtocol>
    <Platform>x64</Platform>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
    <SelfContained>true</SelfContained>
    <PublishSingleFile>False</PublishSingleFile>
    <Configuration>Release</Configuration>
  </PropertyGroup>
</Project>

Expected behavior

Publish should succeeded.

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.6.3: 1.6.241114003

Windows version

Windows 11 (24H2): Build 26100

Additional context

No response

@Higeneko9 Higeneko9 added the bug Something isn't working label Nov 23, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners
Projects
None yet
Development

No branches or pull requests

1 participant