2

I have 2 different folders in my vscode workspace containing html..css files I want to open the two different html files with live server. when I open the first one it says "Server is Started at port : 5500" and it creates a new browser window and it works, when I try to open the 2nd one it says "Server is already running from different workspace." how can I solve this ? I read someone says that I can open it from a different port, how can I do that ?

rioV8
  • 24,506
  • 3
  • 32
  • 49
B-M Amine
  • 39
  • 1
  • 6

1 Answers1

0

You need to change the port of one of your servers. To do this, go to your settings.json file and assign the value "liveServer.settings.port": 0 to either 0 (for a random port) or another value that is not 5500 so that the servers are running on separate ports.

See this answer for more info: Where to set value of liveServer.settings.port in live server extension of visual studio code

Patrick Gorman
  • 132
  • 1
  • 8
  • I changed the value to 0 , the server now is running at a random port but it didn't solve the problem. when I try with the 2nd file it says "Server is already running from different workspace." – B-M Amine Apr 30 '22 at 05:56
  • Hm... It looks like you should be able to open multiple files in the same workspace in liveserver by simply right clicking them and clicking ```Open With Live Sever```. https://stackoverflow.com/questions/67965138/how-can-i-view-two-html-pages-on-live-server-in-visual-studio-code Are you sure you're opening both of these in the same workspace? – Patrick Gorman Apr 30 '22 at 16:10
  • It's working only if the 2 html files are in the same folder, I have 2 folders in my workspace and each html file is in one of them. – B-M Amine May 01 '22 at 03:51