C
C#2mo ago
Kevin George

✅ How to run the active file on VS Code

So basically I have a 2 folders with different projects, one is ConsoleApp1 and one is StudentGPACalc, when I run StudentGPACalc using Ctrl+F5, it runs ConsoleApp1 instead. But when I use the run button on top left saying "Run project associated with this file", it runs my actively editing file. I want to use Ctrl+F5 to run my actively editing project. How to do it? Whenever I do Ctrl+F5 on my active file, the terminal keeps providing me solution of ConsoleApp1
No description
13 Replies
honey the codewitch
I use Vstudio for .NET, but looking online with google it looks like you have to use dotnet run from the terminal to run your project. Ctrl+F5 always runs the active file in VS Code. That's just how it works. If you want Ctrl+F5 to run your project, use Visual Studio instead
honey the codewitch
Microsoft
.NET Tutorial - Hello World in 5 minutes | .NET
Step-by-step instructions and videos for installing .NET and building your first Hello World .NET application. Develop with free tools for Linux, macOS, and Windows.
ero
ero2mo ago
you almost certainly have created a launch profile when you first hit Ctrl+F5. that profile is tied to exactly one project
ero
ero2mo ago
best you can really do is assign some keybind to this command
No description
ero
ero2mo ago
i wouldn't recommend unbinding ctrl+f5 to replace the default behavior, you'll probably want to use launch profiles at some point
Kevin George
Kevin GeorgeOP2mo ago
oh aight
Kevin George
Kevin GeorgeOP2mo ago
well, it says this
No description
ero
ero2mo ago
that's what i'm getting as well, i'm opening an issue
Kevin George
Kevin GeorgeOP2mo ago
and for some reason this works
No description
Kevin George
Kevin GeorgeOP2mo ago
but not the shortcut
ero
ero2mo ago
Kevin George
Kevin GeorgeOP2mo ago
aight Thanks
ero
ero2mo ago
for now i suppose you'll have to click manually. i'm not sure if launch profiles can be configured to launch the currently loaded project

Did you find this page helpful?