microsoft / microsoft/WindowsAppSDK

PublishSingleFile does not allow the use of RuntimeIdentifiers

Open
#3,539 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area-DeveloperTools
Dominant language
C++
Stars
4.7k
Forks
471
Avg merge
3d 13h
Merged PRs (30d)
28

Description

Describe the bug

If you want to publish your app as a single file for multiple platforms, you can't.

The following error is displayed:

It is not supported to publish an application to a single-file without specifying a RuntimeIdentifier. You must either specify a RuntimeIdentifier or set PublishSingleFile to false.

Steps to reproduce the bug
  1. Open your .csproj
  2. Add <PublishSingleFile>true</PublishSingleFile>
  3. Add <RuntimeIdentifiers>win10-x64;win10-x86</RuntimeIdentifiers>
  4. Try to create a package locally using Create app packages > Sideloading

The only way it works is by replacing RuntimeIdentifiers with RuntimeIdentifier, but the last one only allows one value to be specified, like this: <RuntimeIdentifier>win10-x64</RuntimeIdentifier>

Expected behavior

We need to be able to publish our apps on all platforms available if our apps support that. This is a limitation and a lot of users can't benefit from using our app if we are only allowed to specify 1 platform.

PublishSingleFile should work together with RuntimeIdentifiers.

The workarounds are:

  • PublishSingleFile to false, but this will then require users to manually install .NET Runtime, which is not an easy process, especially for non-technical users.
  • manually change and rebuild for every platform, but this requires us to edit the csproj file everytime we have an update, which is not ideally from a developer experience point of view. (we also have Platforms and AppxBundlePlatforms that need updates)

Installing and developing apps for the Microsoft Store should be a smooth process, and right now, this missing feature stays in the way of making it possible.

Please at least let us know if this could be fixed or not :)

Screenshots

No response

NuGet package version

Windows App SDK 1.3 Preview 1: 1.3.230228005-preview1

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022

Additional context

No response

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 with the .csproj settings using PublishSingleFile and RuntimeIdentifiers, then reproduce the failure through Visual Studio's Create app packages > Sideloading flow. Compare the behavior with a singular RuntimeIdentifier and verify that packaging succeeds for all listed platforms without requiring repeated project edits.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, 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.