Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to launch/debug ASP.NET Web Site after upgrading to Visual Studio 2013

I've just installed Visual Studio (Ultimate) on my development machine. The install seemed to go fine, but when I try to run a VS2012 ASP.NET Web Application project, IE launches and gives me:

Error: Internet Explorer cannot display the webpage

IIS Express is installed, and the project is set to use IIS Express:

VS2013 showing the project set to use IIS Express

IIS Express is running, the port is open etc, but it doesn't appear to be serving any webpages. If I look in the IIS Express logs, I can see the requests being returned with what looks like a 303 error:

2013-12-23 14:22:49 ::1 GET /login.aspx - 25869 - ::1 Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) - 303 0 0 0
2013-12-23 14:22:53 ::1 GET /login.aspx - 25869 - ::1 Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) - 303 0 0 0

Any ideas what I need to do/undo to get VS2013 running my project?

like image 843
KenD Avatar asked Dec 23 '13 14:12

KenD


People also ask

How do I fix unable to start Debugging on web server?

Restart your Application Pool. Check that your Web Application folder has the right permissions. Make sure that you give IIS_IUSRS, IUSR, or the specific user associated with the Application Pool read and execute rights for the Web Application folder. Fix the issue and restart your Application Pool.

How do I fix unable to launch the IIS Express web server?

Try deleting the automatically-created IISExpress folder, which is usually located at %userprofile%/Documents , e.g. C:\Users\[you]\Documents\IISExpress . Don't worry, VS should create it again - correctly, this time - once you run your solution again. This worked for me.

Why is w3wp exe not running?

Answers. The w3wp.exe will not appear until the first request has entered the pipeline. So if you browse to your site and then open your task manager, you will see the w3wp.exe.


2 Answers

Cracked it. My 'web.config' file had the following rewrite rule:

<rewrite>
  <rules>
    <rule name="Redirect to HTTPS" stopProcessing="true">
      <match url="(.*)"/>
      <conditions>
        <add input="{HTTPS}" pattern="^OFF$"/>
      </conditions>
      <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther"/>
    </rule>
  </rules>
</rewrite>

... which would force HTTPS on the live site. This didn't cause a problem when using VS2012's Cassini development web server, but as that's now been replaced it seems that IIS Express is trying to enact the rewrite rule. I'm not sure if the URL Rewrite module is available or compatible with IIS Express, but I can easily comment out the offending lines for now and leave them in place on the live site.

like image 184
KenD Avatar answered Oct 01 '22 20:10

KenD


Check you web config and see if you have this

<authentication mode="Forms">
  <forms loginUrl="~/login.aspx" />
</authentication>

I have had a redirect problem when I installed 2013 and it was centered on the forms loginUrl

like image 31
Tim Avatar answered Oct 01 '22 22:10

Tim