dotnet new console, publish, makes a dll not an exe
See original GitHub issueC:\PLAy\asdf>dotnet --version
2.0.0-preview1-005694
C:\PLAy\asdf>dotnet new console
The template "Console Application" was created successfully.
C:\PLAy\asdf>dotnet restore
...
C:\PLAy\asdf>dotnet run
Hello World!
C:\PLAy\asdf>dotnet publish
Microsoft (R) Build Engine version 15.2.47.30403
Copyright (C) Microsoft Corporation. All rights reserved.
asdf -> C:\PLAy\asdf\bin\Debug\netcoreapp2.0\asdf.dll
Shouldn’t I have a console .exe? How do I run this dll?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:139 (60 by maintainers)
Top Results From Across the Web
dotnet new console, publish, makes a dll not an exe #8065
On Linux and macOS, this should run the installed version of .Net Core. On Windows, the .dotnet extension would be registered with dotnet.exe...
Read more >.Net Core 2.1 produces .dll instead of .exe & ...
I have a .NET Core. <Project Sdk="Microsoft.NET.Sdk">. Target framework = .NET Core 2.1. Output type = Console Application.
Read more >Build .NET Core console application to output an EXE
Steps · Right-Click on Project, and click Publish · Click Start and choose Folder target, click next and choose Folder · Click on...
Read more >How to Create a .NET Core CLI Console App as an EXE ...
NET Core CLI tools it only produces a DLL by default. If you execute this: dotnet new console -n App. And then execute...
Read more >visual studio is building a console application as a dll ...
The project type on the properties page says “Console Application”, the <OutputTpe> element in the proj file says its an Exe, yet VS...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Can we reduce the confusion somehow? I work on .NET Core and I was confused.
<OutputType>Exe</OutputType>
reads exe but does not correspond to an exe. That’s clearly confusing. Are we really out of options due to back compat? Why?Console Application
is the name of the template. For 15 years in .NET that has meant an .exe. Can we call the template something else, that’s meaningful?@terrajobst
.net core apps aren’t supposed to be “.exe” files as this is a windows concept. When a portable app is published, the resulting
.dll
is supposed to be run on the target platform throughdotnet app.dll
which will then use the platform-specific runtime.In project.json, the property was
emitEntryPoint: true
. In csproj,<OutputType>Exe</..>
has existed before and should rather be interpreted asExecutable
rather than.exe file
…Tooling already exists for
OutputType
, yet it would be more clear if there was<Runnable>true</..>
(which would internally just set the output type).