Amit Rai

Amit Rai

  • NA
  • 56
  • 3.4k

Hosting asp.net website on IIS

Jun 15 2017 5:49 AM

Recently I have made a website on VS2012 with C# and after hosting it on IIS7 in Windows 7(32bit); unable to view website while browsing it “localhost refused to connect”.

For this I have applied following processes:

1. Check IIS->www services->Application Development Features-> Enable ASP.NET, ISAPI Exten and Filters

2. Publish my website as “File System” publish method successfully.

3. Cmd prompt cd %windir%\Microsoft.NET\Framework\V4.0.30319 press enter and then

asp_netregiis.exe –I –enable

4. Open IIS Manager as Admin, Right Click on Sites ->Add Website->Enter Site Name, Physical path, IP Address of My PC and change port to 10 (Since My PC connected through LAN)

On Click “Test Settings” I got a warning in Authorization : can not verify access to path(C:\MyWebsite)

On Click “Connect as…” I select Application User (pass through authentication)

5. In Application Pool of my website Set .NET framework to 4.0

6. Now I added Default document

I also tried these tricks

· Giving a host name as www.mysite.com and add it on C->Windows->System32->drivers->etc->hosts (open it in notepad) then write

127.0.0.1 www.mysite.com & save it.

· Also tried to host my website inside inetpub->wwwroot

· Impersonate in web.config, <identity impersonate="true" /> inside <System.web>

· Authentication in IIS of my site set Anonymous authentication Enable & Impersonation Enable

Pl help me.


Answers (3)