Hosting asp.net 4.5/4.5.1 Web application on Local IIS
1)Be Sure
IIS Installation before Visual Installation Installataion then aspnet_regiis will already registerd with IIS
If Not Install IIS and then Register aspnet_regiis with IIS by cmd Editor
For VS2012 and 32 bit OS Run Below code on command editor :
1)Install IIS First & then
2)
cd C:\Windows\Microsoft.NET\Framework\v4.0.30319
C:\Windows\Microsoft.NET\Framework\v4.0.30319> aspnet_regiis -i
For VS2012 and 64 bit OS Below code on command editor:
1)Install IIS First & then
2)
cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319
C:\Windows\Microsoft.NET\Framework64\v4.0.30319> aspnet_regiis -i
BY Following Above Steps Current Version of VS2012 registered with IIS
Hosting (VS2012 Web APP)
Create VS2012 Web Application(WebForm/MVC) then Build Application
Right Click On WebApplication(WebForm/MVC) go to 'Properties'
Click On 'Web' Tab on then 'Use Local IIS Web Server'
Then Uncheck 'Use IIS Express'
(If Visul Studio 2013 Select 'Local IIS' from Dropdown)
Provide Project Url like "http://localhost/MvcDemoApp"
Then Click On 'Create Virtual Directory' Button
Then Open IIS by Prssing 'Window + R' Run Command and type 'inetmgr' and 'Enter' (or 'OK' Button)
Then Expand 'Sites->Default Web Site' you Hosted Successfully.
If Still Gets any Server Error
like 'The resource cannot be found.'
Then Include following code in web.config
<configuration>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"></modules>
And Run Application
If still problem occurs
Check application pool by : In iis Right click on application->Manage Application->Advanced setting->General. you see the application pool.
then close advance setting window.
click on 'Application Pools' you will see the all application pools in middle window.
Right click on application pool in which application hosted(DefaultAppPool).
click 'Basic Setting' -> Change .Net FrameWork Version to->.Net FrameWork v4.0.30349