Hi I was just wondering if you were able to solve this issue? I am experiences the same error.
Guys hello, i have the same problem but i could not solve it.
When i press Open with live server below message appears «Open a folder or workspace… (File -> Open Folder)», I opened any html file there many times but nothing about live server works ,guys how can i solve this?please any help
Kind Regards
AlaaSarhan9, Manghyi, OdaiSy, murlidharpathakprogrammer, musatoktas, kevinramadhan29, Jayasimha099, hichamsyc11, Harpreetkaur125, Sahinujjaman-Rahaman, and 37 more reacted with eyes emoji
hi
Want to known how to open more than one html file using live server in visual studio code
And when i try open more than one file with live server it is opening that files on same port, but when try to close live server for one file it is closing for all files opened on that port
So please tell me how to use live server for multiple files in visual studio code
I’m facing the same issue can anybody help me please!
«Open a folder or workspace… (File -> Open Folder)»
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
Geek2452, Yashr29-max, rafaellang1, souza-jefte, HackerPractice, aman-git13, Rahim47, Axist8, Silferion, Gopipatwa, and 21 more reacted with laugh emoji
AlaaSarhan9, giddygarcia, rafaellang1, musatoktas, ocholuo, kulu123-z, aman-git13, elzurdo, Rahim47, Axist8, and 27 more reacted with hooray emoji
kulu123-z, aman-git13, Rahim47, itxDeeni, Axist8, AwaisKazimi, Gopipatwa, loglost, Wang-Kevin900, sdobnaya, and 44 more reacted with heart emoji
kulu123-z, elzurdo, Rahim47, cemenyo, Axist8, loglost, Wang-Kevin900, sdobnaya, shubham-20120, Asrover, and 16 more reacted with rocket emoji
luisprz, jenwesi, JayP11, Aaryajith, Echolano, emman01-ship, Diego223, and hanselpinto reacted with eyes emoji
it really works……………
Will you please attach screenshot or write your issue which you are facing?
It will help me to understand related problem
…
Thanks, but It worked with the help of your previous answer.
Didn’t work for me
![]()
Try doing «ctrl O» and then open the file. This will solve it. You might have seen «Not Opened In Folder» notification
go to file>open folder> then open the folder where .html file is saved dont open the file just open the folder
jy615 reacted with laugh emoji
YeloFx reacted with hooray emoji
AboSnehajit reacted with heart emoji
TamarDvorkin and AboSnehajit reacted with rocket emoji
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
sry but i cant understand please can you helped me to solved this prob…….
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
thankyou pihu01 its working ……….
thanks alot….
I’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release) [X ] Bug report <!-- Please search GitHub for a similar issue or PR before submitting --> [X ] Feature request [ X] Documentation issue or request [ ] Other: <!-- Please describe: -->
Current behavior
With a HTML page open, I hit Ctrl+Shift+P and type Live Server: Open with Live Server but I get a error saying Open a folder or workspace… (File -> Open Folder)
Expected behavior
Should open a standalone HTML file.
Environment
Browser: - [ ] Chrome (desktop) version XX - [ ] Firefox version XX - [ ] Safari (desktop) version XX - [X ] IE version 11 - [ ] Edge version XX For Tooling issues: - Live Server: Latest - Platform: Windows - Visual Studio Code: 1.29.1
Others
Open your folder in Vscode explorer
the same question occured,can anybody help me figure it out ? 3q
Vscode>File>Open folder >»choose the folder where you saved .html file.
then click on «alt+alt+o» to start live server.
i can make a short video if you cant understand me.
yep,i understand,i had try to find out folder,but it doesn’t work finally.I am so much appreciated if you could send me the video.
I’m facing the same issue can anybody help me please!
«Open a folder or workspace… (File -> Open Folder)»
where are the solutions??
Hi, I am facing the same issue. I tried opening in the folder location, and the folder in VS code explorer, it didn’t work. Can anyone help me out? Thanks in advance.
What a pity btw,i don’t know how to solve out the problem either.i am so soory for that,i am considering to download another editor such as Hbuilder replacing of vscode and let it go as for liverserver
Best Regards,
Allen
…
—————— 原始邮件 ——————
发件人: »arvinmi»<notifications@github.com>;
发送时间: 2020年5月25日(星期一) 下午2:20
收件人: »ritwickdey/vscode-live-server»<vscode-live-server@noreply.github.com>;
抄送: »Allen»<53370387@qq.com>;»Comment»<comment@noreply.github.com>;
主题: Re: [ritwickdey/vscode-live-server] «Open a folder or workspace… (File -> Open Folder)» when «> Live Server: Open with Live Server» without a folder being open (#248)
Hi, I am facing the same issue. I tried opening in the folder location, and the folder in VS code explorer, it didn’t work. Can anyone help me out? Thanks in advance.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
I cant believe that worked
i had try,but the error existed all the time.Do you have other solutions to aviod it?
Thank you so much~
Best Regards,
Allen
…
—————— 原始邮件 ——————
发件人: «HackerPractice»<notifications@github.com>;
发送时间: 2020年5月31日(星期天) 晚上8:57
收件人: «ritwickdey/vscode-live-server»<vscode-live-server@noreply.github.com>;
抄送: «Allen»<53370387@qq.com>; «Comment»<comment@noreply.github.com>;
主题: Re: [ritwickdey/vscode-live-server] "Open a folder or workspace… (File -> Open Folder)" when "> Live Server: Open with Live Server" without a folder being open (#248)
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
I cant believe that worked
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
thank you maam
it really works
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
thank you, it worked for me
thanks for your reminding,i am trying to do so but it doesn’t work at present,could you show me the pictures what you operate on?
thank you so much for your support.
Best Regards,
Allen
…
—————— 原始邮件 ——————
发件人: «shahnaeem»<notifications@github.com>;
发送时间: 2020年6月22日(星期一) 凌晨5:28
收件人: «ritwickdey/vscode-live-server»<vscode-live-server@noreply.github.com>;
抄送: «Allen»<53370387@qq.com>; «Comment»<comment@noreply.github.com>;
主题: Re: [ritwickdey/vscode-live-server] "Open a folder or workspace… (File -> Open Folder)" when "> Live Server: Open with Live Server" without a folder being open (#248)
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
thank you, it worked for me
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
many thanks for the solution after 5 hours research….
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
it worked! Thank you!
Wow! I got the solution,
whenever you try to open the file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exists) in visual studio code, and then you can open live server by right click.
thank you
It’s working thanks learner
well we should thanks to ‘Pihu01’ up there
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
It worked for me …thanks for posting
right click on UNTITLED (WORKSPACE) and select ADD FOLDER TO WORKSPACE
select the folder you wan to add and continue working.
you can also click on FILE and select ADD FOLDER TO WORKSPACE. then select the complete folder of your code.
Guyz…. its not working because you might have selected «open file» option to put your file in VS Code, instead try to select «open folder» option in VS Code and it will surely gonna work. 👍 💯 💯 💯 💯 💯 💯 💯 💯 💯 💯
For Apple users,
hi guys what worked for me it was, when i went to open the folder the system just took me right to the folder, i clicked out of there like were the folder is, then i went to the folder then the file, if the bottom line turns blue in vscode that means it worked. let me know please.
you can also click on FILE and select ADD FOLDER TO WORKSPACE. then select the complete folder of your code.
Exactly make sure all the folders you have your files in are saved in a «WORKSPACE FOLDER». Put all your files in the Workspace Folder, then open the files from your workspace folder by using VSCODE to open it.
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
thanx that really helped
I got a solution
open vs code
then click on files then click on open folder, select the folder where your html file is.
then click on right click open with server.
it will work
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
Thank you! I did it!
go to File , Then to Open Folder and then go to Select . And now you can select your file .
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
Thanks! You are the best!
It worked for me. Thanks.
thank you Pihu01
it works
eyobai
Thank you- it works!
vá para arquivo>abrir pasta> depois abra a pasta onde o arquivo .html está salvo não abra o arquivo apenas abra a pasta
Consegui resolver com sua ajuda. grato!!!!!!!!!!!
solution:
on VSC go to upper left: file>open folder
select the folder which contains the .html files
after that, the folder opens in VSC and you will be able to run the live server on each html file.
Wow! I got the solution, whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click. thank you
6666
«Open a folder or workspace… (File -> Open Folder)» when «> Live Server: Open with Live Server» without a folder being open» This issue happens to me too when I just create file in VS and just run it, so I just create some folder and put the file their and it works.
Wow! I got the solution, whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click. thank you
Thanks!
Hello everyone , i had a same issue. But i open html file in browser and open html file in vscode and it works , opening another folder or workspace is not a good way cause , machine spends power for unnecessary things when you unnecessary folder or workspace
Wow! I got the solution, whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click. thank you
Thank you. It worked
What is a VS Code «workspace»?
A Visual Studio Code «workspace» is the collection of one or more folders that are opened in a VS Code window (instance). In most cases, you will have a single folder opened as the workspace but, depending on your development workflow, you can include more than one folder, using an advanced configuration called Multi-root workspaces.
The concept of a workspace enables VS Code to:
- Configure settings that only apply to a specific folder or folders but not others.
- Persist task and debugger launch configurations that are only valid in the context of that workspace.
- Store and restore UI state associated with that workspace (for example, the files that are opened).
- Selectively enable or disable extensions only for that workspace.
You may see the terms «folder» and «workspace» used interchangeably in VS Code documentation, issues, and community discussions. Think of a workspace as the root of a project that has extra VS Code knowledge and capabilities.
Note: It is also possible to open VS Code without a workspace. For example, when you open a new VS Code window by selecting a file from your platform’s File menu, you will not be inside a workspace. In this mode, some of VS Code’s capabilities are reduced but you can still open text files and edit them.
How do I open a VS Code «workspace»?
The easiest way to open a workspace is using the File menu and selecting one of the available folder entries for opening. Alternatively if you launch VS Code from a terminal, you can pass the path to a folder as the first argument to the code
command for opening.
Single-folder workspaces
You don’t have to do anything for a folder to become a VS Code workspace other than open the folder with VS Code. Once a folder has been opened, VS Code will automatically keep track of things such as your open files and editor layout so the editor will be as you left it when you reopen that folder. You can also add other folder-specific configurations such as workspace-specific settings (versus global user settings), task definitions, and debugging launch files (see below in the workspace settings section).
A single-folder workspace opened inside VS Code
Multi-root workspaces
Multi-root workspaces are an advanced capability of VS Code that allows you to configure multiple distinct folders to be part of the workspace. Instead of opening a folder as workspace, you will open a <name>.code-workspace
JSON file that lists the folders of the workspace. For example:
{
"folders": [
{
"path": "my-folder-a"
},
{
"path": "my-folder-b"
}
]
}
A multi-root workspace opened in VS Code
Note: The visual difference of having a folder opened versus opening a
.code-workspace
file can be subtle. To give you a hint that a.code-workspace
file has been opened, some areas of the user interface (for example, the root of the File Explorer) show an extra (Workspace) suffix next to the name.
Untitled multi-root workspaces
It is easy to add or remove folders in your workspace. You can start off by opening a folder in VS Code and then later add more folders as you see fit. Unless you already have opened a .code-workspace
file, the first time you add a second folder to a workspace, VS Code will automatically create an «untitled» workspace. In the background, VS Code automatically maintains a untitled.code-workspace
file for you that contains all of the folders and workspace settings from your current session. The workspace will remain «untitled» until you decide to save it to disk.
An untitled multi-root workspace opened in VS Code
Note: There is really no difference between an untitled workspace and a saved workspace other than the fact that an untitled workspace is automatically created for you for your convenience and will always restore until you save it. We automatically delete untitled workspaces (after asking you for confirmation) when you close a window in which an untitled workspace is opened.
Workspace settings
Workspace settings enable you to configure settings in the context of the workspace you have opened and always override global user settings. They are physically stored in a JSON file and their location depends on whether you opened a folder as a workspace or you opened a .code-workspace
file.
Refer to the settings documentation for a comprehensive explanation of setting scopes and their file locations.
Single-folder workspace settings
Workspace settings will be stored in .vscode/settings.json
when you open a folder as workspace.
The Settings editor when a folder is opened as workspace
Multi-root workspace settings
When you open a .code-workspace
as workspace, all workspace settings will be added into the .code-workspace
file.
You can still configure settings per root folder and the Settings editor will present a third setting scope called Folder Settings:
The Settings editor when a multi-root workspace is opened
Settings configured per folder will override settings defined in the .code-workspace
.
Workspace tasks and launch configurations
Similar to how workspace settings are specific to a workspace, tasks and launch configurations can also be scoped to a workspace. Depending on whether you have a folder opened as workspace or a .code-workspace
file, the location of workspace task and launch configurations will either be inside the .vscode
folder or inside the .code-workspace
file. In addition, task and launch configurations can always be defined at the level of a folder, even when you have opened a .code-workspace
file.
Refer to tasks and debugging chapters for a more comprehensive overview of how to use tasks and launch configurations in VS Code.
Common questions
What is the benefit of multi-root workspace over a folder?
The most obvious advantage is that a multi-root workspace allows you to work with multiple projects that may not be stored inside the same parent folder on disk. You can pick folders from anywhere to add to the workspace.
Even if you are mainly working in a single-folder-based project, you can benefit from using .code-workspace
files. You can store multiple .code-workspace
files inside the folder to provide a scoped folder-view of certain aspects of the project depending on the scenario (for example client.code-workspace
, server.code-workspace
to filter out unrelated folders from the File Explorer). Since .code-workspace
files support relative paths for the folders
section, these workspace files will work for everyone independent of where the folder is stored.
Finally, if for some projects you want to apply the same set of workspace settings or tasks/launch configurations, consider adding these into a .code-workspace
file and add/remove these folders from that workspace.
Why is VS Code restoring all untitled workspaces on a restart?
Untitled workspaces are designed to be something you must explicitly decide to keep or not. The first time an untitled workspace is created, VS Code adds the specified folders into the workspace file and also all existing workspace settings. This user data is always restored and displayed in a VS Code window until the untitled workspace is saved or deleted.
How do I delete an untitled workspace?
You can delete an untitled workspace by closing its window and dismissing the prompt to save the untitled workspace.
Can I use a multi-root workspace without folders
It is possible to leave the folders
section of a .code-workspace
file empty so that you end up with an instance of VS Code that does not show any root folders. You can still store workspace settings and even tasks or launch configurations in this case.
Does VS Code support projects or solutions?
VS Code doesn’t have the concept of a «project» or «solution» as they are sometimes defined in other development tools, for example Visual Studio IDE. You may see the term «project» used in VS Code documentation but it usually means «the thing you’re working on». Depending on your programming language or framework, the toolset itself may support something called a «project» to help define build configurations or enumerate included files.
2/2/2023
«Open a folder or workspace… (File -> Open Folder)» when «> Live Server: Open with Live Server» without a folder being open
I’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release) [X ] Bug report <!-- Please search GitHub for a similar issue or PR before submitting --> [X ] Feature request [ X] Documentation issue or request [ ] Other: <!-- Please describe: -->
Current behavior
With a HTML page open, I hit Ctrl+Shift+P and type Live Server: Open with Live Server but I get a error saying Open a folder or workspace… (File -> Open Folder)
Expected behavior
Should open a standalone HTML file.
Environment
Browser: - [ ] Chrome (desktop) version XX - [ ] Firefox version XX - [ ] Safari (desktop) version XX - [X ] IE version 11 - [ ] Edge version XX For Tooling issues: - Live Server: Latest - Platform: Windows - Visual Studio Code: 1.29.1
Others
Hi I was just wondering if you were able to solve this issue? I am experiences the same error.
Guys hello, i have the same problem but i could not solve it.
When i press Open with live server below message appears «Open a folder or workspace… (File -> Open Folder)», I opened any html file there many times but nothing about live server works ,guys how can i solve this?please any help
Kind Regards
hi
Want to known how to open more than one html file using live server in visual studio code
And when i try open more than one file with live server it is opening that files on same port, but when try to close live server for one file it is closing for all files opened on that port
So please tell me how to use live server for multiple files in visual studio code
I’m facing the same issue can anybody help me please!
«Open a folder or workspace… (File -> Open Folder)»
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
it really works……………
Will you please attach screenshot or write your issue which you are facing?
It will help me to understand related problem
…
Thanks, but It worked with the help of your previous answer.
Didn’t work for me
![]()
Try doing «ctrl O» and then open the file. This will solve it. You might have seen «Not Opened In Folder» notification
go to file>open folder> then open the folder where .html file is saved dont open the file just open the folder
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
sry but i cant understand please can you helped me to solved this prob…….
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
thankyou pihu01 its working ……….
thanks alot….
I’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release) [X ] Bug report <!-- Please search GitHub for a similar issue or PR before submitting --> [X ] Feature request [ X] Documentation issue or request [ ] Other: <!-- Please describe: -->
Current behavior
With a HTML page open, I hit Ctrl+Shift+P and type Live Server: Open with Live Server but I get a error saying Open a folder or workspace… (File -> Open Folder)
Expected behavior
Should open a standalone HTML file.
Environment
Browser: - [ ] Chrome (desktop) version XX - [ ] Firefox version XX - [ ] Safari (desktop) version XX - [X ] IE version 11 - [ ] Edge version XX For Tooling issues: - Live Server: Latest - Platform: Windows - Visual Studio Code: 1.29.1
Others
Open your folder in Vscode explorer
the same question occured,can anybody help me figure it out ? 3q
Vscode>File>Open folder >»choose the folder where you saved .html file.
then click on «alt+alt+o» to start live server.
i can make a short video if you cant understand me.
yep,i understand,i had try to find out folder,but it doesn’t work finally.I am so much appreciated if you could send me the video.