Search code examples
pythonvisual-studiocompiler-errorsvisual-studio-2022visual-studio-setup

VS ERROR (python) = Project cannot be launched because startup file is not specified


I am new in programming. When I try to learn coding and execute some HTML-Bootstrap pages, I am encountering the below error at the beginning of the exercise. I am using Visual Studio 2022 Community Edition as my IDE.

enter image description here

I couldn't find any solution about that on the Internet.

Do you have any response or solution? Can you explain the solution as I am a very new person at programming and computer environments?

VS ERROR (python) = Project cannot be launched because startup file is not specified


Solution

  • I came across similar error, but googling found the detailed solution by MS at:

    https://learn.microsoft.com/en-us/visualstudio/python/managing-python-projects-in-visual-studio?view=vs-2022

    You can simply:

    1. Right click the Solution in your Solution Explorer selecting the Startup Project to be the relevant one.
    2. Then right click the said project containing the file you want to run, and click properties.
    3. Finally ensure the name of the file you want run is specified in the Startup File box!

    enter image description here