C# WPF application compiles as dll? I want an exe

Nico Felten 96 Reputation points
2022-04-23T16:55:59.32+00:00

I have made a C# WPF application, and if I compile it it creates a dll instead of an exe.
I selected the projects property output type to windows application. I can choose console app, but then you get a dos window to open as well alongside the program, and i dont want that.

How do you run the dll anyways? If I type rundll32 filename then it doesnt start...

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,874 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 84,871 Reputation points
    2022-04-23T17:15:31.287+00:00

    Are you sure that you selected the right Project type ?

    WPF .NET Framework :

    195802-wpf-project.jpg


  2. Bruce (SqlWork.com) 64,741 Reputation points
    2022-04-23T18:08:07.907+00:00

    Net 6 added support for WPF, so you can now. Build WPF applications with net 6.

    Net 6 applications are a dll hosted by net core runtime. dotnet(.exe) is the default. The build will typically create a small exe named after the project that will load and run the dll. With publish you can create a single bundle file that will run.

    See single file deployment

    https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview

    0 comments No comments

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.