In this article we will learn how to Creating an EXE For .Net Core Console Application. Sometime as per the requirement we are create console application but the challenge is how to share this application to others like how a tester can test this application. We can’t share the source code directly to others we should share the file as protected. To get rid of this issue the best way is that we should create an EXE file of .Net Core console app and send that EXE file to others. Here In this article, we basically going to learn how to create an EXE file over .Net Core console. Please read my previous article of JWT Authentication And Authorization With Identity Framework in .NET Core 6.0.
Creating a sample .Net Core console application
Create a .NET Core console application using Visual studio templates.
If you can build the project and when move to Debug folder you can’t find the any EXE file is there. It is not a bug. In .NET Core, it runs from the dll, so you have to just run the application by running the command prompt and using the command –
Let’s run the application and we can see the sample console app output.
Creating an EXE file for the .Net core console App
Let’s create an EXE file using Visual studio wizard of .Net Core console application.
Right click on the project and click on publish
After clicking on publish it opened up a next wizard where we can choose publish type, In my case I have chooses Folder option.
After clicking the next button you can see the below screen where it ask to publish location under Release folder. You can change if you want to save in other location.
After click the Finish button, you can choose the highlighted settings and set target and click on Save button.
Finally click on Publish button, it can publish into desired location.
Jump to the folder location and you can there you find an
ConsoleApp1 exe file present in
Release folder, when you click the application you can see the console window,
If you want to create Desktop create short Icon of the EXE file then follow below steps and click on the shortcut icon you can see the result.
- Rate Limiting in ASP.Net Core Web API using middleware
- Implement Rate Limiting in ASP.Net Core Web API
- Authentication and Authorization in ASP.NET Core with JWT Token
- Create Windows Service/background jobs in .Net Core
- Microservices Architecture in ASP.NET Core-6
- AddTransient Vs AddScoped Vs AddSingleton Example in ASP.Net Core
- Razor file compilation in ASP.NET Core
- ViewData in ASP.Net Core MVC
- How controller finds a view (View Discovery)
- Controller in ASP.NET Core MVC
Jayant TripathyCoder, Blogger, YouTuber
A passionate developer keep focus on learning and working on new technology.