visual-studio.net-coretopshelf

How to create an exe for .NetCore service


I have created a service application in C# using Topshelf. I created it however for the .NetCore platform and not .Net framework. Now I want to deploy the service app on another machine to test it off the development area. It seems that after the build in Visual studio I only find a DLL and a .exe. Is there something speficic I need to do to get the exe or is it because of the .NetCore Platform that I only have a dll and how do I go to deploying the service? What I should add here is that as I created the project in Visual Studio, I created a Consol App (.NET Core) and the TopShelf framework was used.


Solution

  • You can use dll to run .net core. To run .NET Core you just need to have installed .NET Core Runtime which can be found here. Then on this machine you just use dotnet ApplicationName.dll in cmd / powershell. If you want to create exe file instead of dll then you should use command: dotnet publish -r win10-x64

    More information you can find in documentation.