python-3.xvisual-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 am trying to learn codig and execute some HTML-Bootstrap pages, i faced with an error at begining of the exercise.(Visual Studio 2022 Community)

enter image description here

I couldn't find any solution about that on internet.

Do you have any response or solution? can you explain the sollution as I am very new person at programming and computer enviroment?

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


That is how I solved this problem;

  1. Add a python empty module to project,
  2. Set it as a Startup project,
  3. then Run.

That's all.


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