且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在asp.net中创建Web应用程序的exe

更新时间:2022-11-05 20:57:14

发布到旧线程,但是我遇到了这种情况并找到了解决方案.跟随Spring Boot和其他容器化解决方案的脚步,我相信现在Microsoft也已添加了此功能.

Posting to an old thread, but I came across this situation and found the solution. Following footsteps of Spring Boot and other containerized solutions, I believe now Microsoft also has added this feature.

我的情况:创建了一个基本的基于REST的Web应用程序并进行了构建.在Web应用程序根目录下\ bin内创建了Debug and Release文件夹.

My scenario: Created a basic REST based Web application and built it. This created Debug and Release folder within \bin within the root directory of Web application.

它还会创建一个exe文件.

It also creates an exe file.

只需要必要的运行时依赖项(例如,在我的情况下为.NetCore 3.1等)即可运行此exe.

You just need the necessary runtime dependencies (like .NetCore 3.1 etc in my case) to run this exe.

我将整个Web应用程序文件夹复制到Windows Server2016.最初存在一些问题,但是后来当我添加所需的依赖项(我的较早机器中存在的dotnet文件夹)时,它就像一个魅力.

I copied the entire Web application folder to a Windows Server 2016. There were some issues initially, however later when I added the required dependencies (dotnet folder which was present in my earlier machine), it worked like a charm.