You are trying to debug a web site in Visual Studio 2017
Error
Microsoft visual studio is giving the error: Unable to start program http://localhost An operation is not legal
Solution
Disable the JavaScript debugging
- On VS go to Tools >> Options
- Go to Debugging >> General
- Uncheck the option Enable JavaScript debugging for ASP.NET (Chrome and IE)
- Click OK and try again