'How to remove the file path from the Code Runner (VSCode extension) run command for C#?

When using the VSCode extension Code Runner for my C# .NET 6 console app, after hitting the run button, the following command runs in the terminal:

❯ dotnet run "/home/USER/code/c#/MyApp/Program.cs"
Hello, World!
~/code/c#/MyApp ❯

I am wondering how to remove the file path after 'dotnet run'. Given that I am already in the console application directory, I would like for the extension to only execute the 'dotnet run' command, which would achieve the same result. I can demonstrate this by running the command myself without including the file path to the 'Program.cs' file at the end:

❯ dotnet run
Hello, World!
~/code/c#/MyApp ❯

This is purely an aesthetic matter, but it has been bugging me a lot and I've spent more than two hours now trying to figure out a solution for this.



Solution 1:[1]

  1. Go to Vs code setting

  2. Uncheck Show Execution Message option

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rahul bora