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.
- Implement Unit Test in ASP.Net Core Middleware
- Most popular ASP.Net Core Libraries every developer should know
- How to Implement Repository Pattern in ASP.Net Core Web API
- How to run ASP.Net Core Web Application in Docker Container
- ChatGPT Integration in ASP.Net Core using OpenAI
- How to Implement AutoMapper in ASP.Net Core – Beginner’s Guide
- Building CRUD REST APIs in ASP.Net Core 7.0 with EF
- Deploy ASP.Net Core apps to Azure App Service
- How to detect whether page is load on Mobile or Desktop browser in ASP.Net Core
Jayant TripathyCoder, Blogger, YouTuber
A passionate developer keep focus on learning and working on new technology.