0

I want to create a new executable project with Visual Studio Code + omnisharp. It works for dll but not for an exe file.

  1. Created a folder for my new project (e.g. myApp)
  2. Open Visual studio code -> file -> open folder
  3. Open internal VSC terminal and type the following commands

Code:

dotnet new console (pressed yes in popup)
dotnet restore
dotnet run
//hello world was visible in terminal (what means it works)
dotnet build

Build was successful but a dll file was created.

  • Actual result: dll file
  • Expected result: exe file

BTW: I used this for help -> https://github.com/dotnet/docs/blob/master/docs/core/tutorials/with-visual-studio-code.md

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
mA1k
  • 3
  • 1
  • 2

2 Answers2

3

You are using dotnet core, so executable files are still in .dll. To run the file, run dotnet nameofdll.dll

dotnet core is cross-platform, and to reduce the tight coupling with windows, .exe is not used for executables anymore.

If you want your application to be Windows dependant, you will need to make your application target .Net Framework instead - you will get a .exe instead this way.

Luke Parker
  • 299
  • 1
  • 10
-1

If you go into the folder where the app is and go to bin/debug/net6.0, I found a exe file along with four other files I have no idea what they do, and a file called publish, also try F1 and search for publish, that might make these files appear (publish seems to be the same 5 files outside of the publish file).

E_net4
  • 27,810
  • 13
  • 101
  • 139
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 20 '22 at 08:45