question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet new console, publish, makes a dll not an exe

See original GitHub issue
C:\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:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:139 (60 by maintainers)

github_iconTop GitHub Comments

103reactions
danmoseleycommented, Apr 11, 2017

Can we reduce the confusion somehow? I work on .NET Core and I was confused.

  1. <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?
  2. 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

37reactions
dasMullicommented, Apr 4, 2017

.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 through dotnet 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 as Executable 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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found