Normally I use Visual Studio, but I also like VS Code for our web application.
Ctrl+F5 is great to launch the website, but I don’t always want to wait for the project to build and compile TypeScript, etc.
VS Code doesn’t have a way to startup the app (in my current setup), so I have to start Visual Studio and
Ctrl+F5 then leave it running with all its resource usage.
Our team created a .bat file that we can run to get the localhost website running in a few seconds.
@echo off start "" http://localhost:52734 cd "C:\Program Files (x86)\IIS Express" iisexpress /config:"c:\tfs\git\MyApp\.vs\config\applicationhost.config" /siteid:2
Copy this into a new file called startMyApp.bat. Double click that and a console will popup. http://localhost:52734 will now be available to browse.
I have 2 sites in my applicationhost.config, so you may have to modify that.
Note: if you are using a CLI from a framework, webpack or
dotnet run then IIS Express is a thing of the past for you. Enjoy living in the modern world :-)!
Please consider using Brave and adding me to your BAT payment ledger. Then you won't have to see ads! (when I get to $100 in Google Ads for a payout, I pledge to turn off ads)
Also check out my Resources Page for referrals that would help me.