Cant publish my WPF app

Finn 20 Reputation points
2023-10-15T19:53:51.8666667+00:00

User's image

Hello,

I programmed my first app with .NET and now I want to publish it as an single .exe file, but if I right click my file in the explorer and click on "publish" this window opens and not the one that everybody else gets. Am I doing something wrong?

Developer technologies | Windows Presentation Foundation
Developer technologies | .NET | Other
{count} votes

Accepted answer
  1. Hui Liu-MSFT 48,681 Reputation points Microsoft External Staff
    2023-10-16T14:40:31.4566667+00:00

    Hi,@Finn. Welcome to Microsoft Q&A forum.

    It doesn’t work with .NET Framework based projects. According to this thread: Publish a single file app does not create a single file and this link(.NET 5), you may need to use .NET 6 or higher versions of .NET to make it work.

    Based on my test, by using .NET 6, if you choose framework-dependent to publish, you will get two files(.exe, .pdb). If you choose Self-Contained to publish, you will still get some (not a single file) files.

    For more information on single file deployments, you could refer to Single-file deployment.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.