How to make the bloody C# program run?

Has it happened to you that you wrote a C# program (a Console Application) but it did nothing when you ran it?

  • Running it from VS Code works
  • Running it using dotnet run works
  • But if you run the .exe it does nothing. There is no error. It just exits.

It happened to me. The issue was this: in the .csproj file I had:

<OutputType>WinExe</OutputType>

change it to:

<OutputType>Exe</OutputType>

and then it will work!

This entry was posted in Computers, programming, Software and tagged . Bookmark the permalink.

Leave a comment