Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS Express Debugging No Longer Working

I'm using IIS Express with Visual Studio 2013 on Windows 8.1 x64 for a WebAPI 2 application (all en-US here). This worked just fine roughly a month ago, but now I'm getting errors when attempting to debug the application.

If I do not run VS as admin (again, didn't need to do this before), I get:

A first chance exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll

Additional information: Access to the path 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\~AspAccessCheck_c00414062044.tmp' is denied.

A second error occurs after this, or it will be the first error if I run VS as Administrator:

A first chance exception of type 'System.Globalization.CultureNotFoundException' occurred in mscorlib.dll

Additional information: Culture is not supported.

If I run the same WebAPI application from WebMatrix 3, it runs without errors (with or without running 'as Admin').

Project IIS config settings:

<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort>46435</IISExpressSSLPort>
<IISExpressAnonymousAuthentication>enabled</IISExpressAnonymousAuthentication>
<IISExpressWindowsAuthentication>disabled</IISExpressWindowsAuthentication>
<IISExpressUseClassicPipelineMode>false</IISExpressUseClassicPipelineMode>

I also have the application running on http://localhost:46436.

What I also find really strange is that the project properties show "IIS Express" and to use a URL of http://localhost:46436/, but in the project file I'm seeing:

  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
        <WebProjectProperties>
          <UseIIS>True</UseIIS>
          <AutoAssignPort>True</AutoAssignPort>
          <DevelopmentServerPort>46435</DevelopmentServerPort>
          <DevelopmentServerVPath>/</DevelopmentServerVPath>
          <IISUrl>http://localhost:46436</IISUrl>

That may explain my access denied. Regardless if I unset, save, and re-set to use IIS Express (storing it for all users), the <UseIIS> property is set back to true.

EDIT: It looks like "Use IIS" is normal. I created a new WebAPI 2 project as a test. It ran fine under IIS Express OOTB.


1 Answers

I also had this issue. Ended up having to right click the folder in question and add access for the IIS_IUSR account.

If this isn't causing critical errors, you can also disable break mode for this sort of issue via Debug -> Options -> Debugging and check Enable Just My Code (Managed Only)

like image 115
Jay Dawkins Avatar answered Jul 02 '26 05:07

Jay Dawkins



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!