Visual Studio 2017 missing exe file

2019-01-18 14:56发布

(I am using Visual Studio 2017)

I started a small console application. A Discord C# bot. So I always launched this program with Visual Studio. After finishing it, I wanted to put the .exe file on a server, to keep this bot stay online all day long.

In the directory, there is no .exe file.

So I started the application again and saw this console is opened from a different path

"C:\Program Files\dotnet" and this .exe is called "dotnet.exe"

When I want to start this .exe file manually, it closes instantly (maybe because of the missing line of code Console.ReadLine(); I don't know).

Can someone tell me, what to change in Visual Studios settings, to have an .exe file in my correct directory for my console application?

The attached picture shows my bin directory, where the .exe file should normally be. There is a .dll file but I need the .exe ..

enter image description here

1条回答
放荡不羁爱自由
2楼-- · 2019-01-18 15:38

There is no exe file because you created a .NET Core application.

You have two options:

  1. If you want an EXE, you need to target the .NET Framework.
  2. If you don't want to change your code, then you need to install .NET Core on the server and run dotnet pathToDll on a command line
查看更多
登录 后发表回答