• <bdo id='ZFvWr'></bdo><ul id='ZFvWr'></ul>

  1. <i id='ZFvWr'><tr id='ZFvWr'><dt id='ZFvWr'><q id='ZFvWr'><span id='ZFvWr'><b id='ZFvWr'><form id='ZFvWr'><ins id='ZFvWr'></ins><ul id='ZFvWr'></ul><sub id='ZFvWr'></sub></form><legend id='ZFvWr'></legend><bdo id='ZFvWr'><pre id='ZFvWr'><center id='ZFvWr'></center></pre></bdo></b><th id='ZFvWr'></th></span></q></dt></tr></i><div id='ZFvWr'><tfoot id='ZFvWr'></tfoot><dl id='ZFvWr'><fieldset id='ZFvWr'></fieldset></dl></div>
    <legend id='ZFvWr'><style id='ZFvWr'><dir id='ZFvWr'><q id='ZFvWr'></q></dir></style></legend>

    <small id='ZFvWr'></small><noframes id='ZFvWr'>

  2. <tfoot id='ZFvWr'></tfoot>

      Visual Studio 2017 和缺少的 EXE 文件

      时间:2023-05-21

        <tfoot id='Dd3YJ'></tfoot>

          <tbody id='Dd3YJ'></tbody>
      1. <legend id='Dd3YJ'><style id='Dd3YJ'><dir id='Dd3YJ'><q id='Dd3YJ'></q></dir></style></legend>
        <i id='Dd3YJ'><tr id='Dd3YJ'><dt id='Dd3YJ'><q id='Dd3YJ'><span id='Dd3YJ'><b id='Dd3YJ'><form id='Dd3YJ'><ins id='Dd3YJ'></ins><ul id='Dd3YJ'></ul><sub id='Dd3YJ'></sub></form><legend id='Dd3YJ'></legend><bdo id='Dd3YJ'><pre id='Dd3YJ'><center id='Dd3YJ'></center></pre></bdo></b><th id='Dd3YJ'></th></span></q></dt></tr></i><div id='Dd3YJ'><tfoot id='Dd3YJ'></tfoot><dl id='Dd3YJ'><fieldset id='Dd3YJ'></fieldset></dl></div>

            <small id='Dd3YJ'></small><noframes id='Dd3YJ'>

              <bdo id='Dd3YJ'></bdo><ul id='Dd3YJ'></ul>
              1. 本文介绍了Visual Studio 2017 和缺少的 EXE 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                (我使用的是 Visual Studio 2017.)

                我启动了一个小型控制台应用程序.

                解决方案

                更新答案:

                早在 2017 年编写此答案时,.NET Core 仅输出 dll 文件,此后情况发生了变化.现在可以在应用程序的 csproj 中使用此属性来实现:

                <OutputType>Exe</OutputType>

                还有其他部署方法,例如 single-file部署.


                原答案:

                没有 exe 文件,因为您创建了一个 .NET Core 应用程序.

                你有两个选择:

                1. 如果您需要 EXE,则需要以 .NET Framework 为目标.
                2. 如果您不想更改代码,则需要在服务器上安装 .NET Core 并在命令行上运行 dotnet pathToDll

                (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 isn't any .exe file.

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

                "C:Program Filesdotnet" 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).

                What should I 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 file...

                解决方案

                Updated answer:

                When this answer was written, back in 2017, .NET Core only output dll files, this has since changed. This can now be achieved with this property in the application's csproj:

                <OutputType>Exe</OutputType>
                

                There are also additional deployment methods like the single-file deployment.


                Original answer:

                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

                这篇关于Visual Studio 2017 和缺少的 EXE 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:新的.csproj格式 - 如何将整个目录指定为“链接文件".到子目录? 下一篇:首次放置在表单上时如何获取要遵守的 WinForms 自定义控件的默认值

                相关文章

              2. <legend id='GNvVs'><style id='GNvVs'><dir id='GNvVs'><q id='GNvVs'></q></dir></style></legend>

                <i id='GNvVs'><tr id='GNvVs'><dt id='GNvVs'><q id='GNvVs'><span id='GNvVs'><b id='GNvVs'><form id='GNvVs'><ins id='GNvVs'></ins><ul id='GNvVs'></ul><sub id='GNvVs'></sub></form><legend id='GNvVs'></legend><bdo id='GNvVs'><pre id='GNvVs'><center id='GNvVs'></center></pre></bdo></b><th id='GNvVs'></th></span></q></dt></tr></i><div id='GNvVs'><tfoot id='GNvVs'></tfoot><dl id='GNvVs'><fieldset id='GNvVs'></fieldset></dl></div>
                <tfoot id='GNvVs'></tfoot>
                  <bdo id='GNvVs'></bdo><ul id='GNvVs'></ul>

                    <small id='GNvVs'></small><noframes id='GNvVs'>