Visual Studio 2017和丢失的EXE文件 [英] Visual Studio 2017 and a missing EXE file
问题描述
(我正在使用Visual Studio 2017.)
(I am using Visual Studio 2017.)
我启动了一个小型控制台应用程序.一个 Discord C#机器人.因此,我总是使用Visual Studio启动该程序.完成后,我想将.exe文件放在服务器上,以使该bot整天保持在线状态.
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.
在该目录中,没有任何.exe文件.
In the directory, there isn't any .exe file.
因此,我再次启动了该应用程序,并看到从另一个路径打开了该控制台:
So I started the application again and saw this console is opened from a different path:
"C:\ Program Files \ dotnet",此.exe称为"dotnet.exe"
"C:\Program Files\dotnet" and this .exe is called "dotnet.exe"
当我要手动启动此.exe文件时,它会立即关闭(可能是由于缺少代码行[c0>我不知道).
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).
我应该在Visual Studios设置中进行哪些更改,以便在我的控制台应用程序的正确目录中包含一个.exe文件?
What should I change in Visual Studios settings to have an .exe file in my correct directory for my console application?
所附图片显示了我的bin
目录,该目录通常是.exe文件所在的目录.有一个.dll文件,但我需要.exe文件...
The attached picture shows my bin
directory, where the .exe file should normally be. There is a .dll file, but I need the .exe file...
推荐答案
没有exe文件,因为您创建了.NET Core应用程序.
There is no exe file because you created a .NET Core application.
您有两个选择:
- 如果要使用EXE,则需要定位.NET Framework.
- 如果您不想更改代码,则需要在服务器上安装.NET Core并在命令行上运行
dotnet pathToDll
这篇关于Visual Studio 2017和丢失的EXE文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!