Chrome Error code: ERR_UNSAFE_PORT This webpage is not available

Hello,

This post about an issue I faced while debugging an asp.net mvc application in Google Chrome. (Version 40.0.2214.111 m). I bulit my website using MVC 4 Template in Visual Studio 2010, designed a top menu and started testing the UI. By default visual studio was opening up the homepage in IE 🙂 , everything was running as expected, so just to see how it works in Chrome, I opened IIS Express url (localhost:6000), and the below error shown up “This webpage is not available“.

CHROME_ERR_UNSAFE_PORT

Show details link revealed more info Chrome Error code: ERR_UNSAFE_PORT

Alright it looks like not all ports are supported by the chrome browser. This is because of Chrome restricting the local ports.

How To fix the issue

1. Change Website Port setting in Visual Studio (Recommended) OR

2. Add the testing port(here 6000) as an allowed port to Google Chrome Explicitly

How To Change Website Port setting in Visual Studio

1. Right click your website project in the solution, select properties, select “Web” Tab in the Servers Section/Use Visual Studio Development Server, Specific Port give a random port no that is not used by any other application in your machine.

WebsitePortSetting

How to allow port in Google Chrome explicitly :

Right click on the chrome shortcut (Desktop/StartMenu/Quick Launch) -> Properties -> Change the target:

“C:\Program Files (x86)\Google\Chrome\Application\chrome.exe” –explicitly-allowed-ports=81,84,87

New shortcut command should like this , if Chrome is installed on the default installation location.

More Info:

http://superuser.com/questions/188006/how-to-fix-err-unsafe-port-error-on-chrome-when-browsing-to-unsafe-ports

Advertisements
This entry was posted in ASP.NET, IIS and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s