How to fix ASP.NET Web Forms App: “Hmm… can’t reach this page” error when running project in Visual Studio

Jordan Prioleau 0 Reputation points
2025-10-26T23:01:17.3466667+00:00

Hi everyone 👋,

I’m working on an ASP.NET Web Forms project in Visual Studio (targeting .NET Framework), and I’m trying to build a simple page hit counter using session state and a label control. The code compiles fine, but when I run the project (F5), the browser (Edge or Chrome) shows:

“Hmm… can’t reach this page” or “This site can’t be reached”

I’ve already tried:

  • Deleting the .vs folder
  • Rebuilding the project
  • Confirming the Default.aspx page is set as the start page
  • Checking the Inherits and CodeBehind attributes in the markup
  • Running as administrator
  • Using localhost with the correct port

Still nothing. I’m not using ASP.NET Core—this is a Web Forms app built manually after the template didn’t show up in Visual Studio. I’ve also verified that IIS Express is running and that the port matches.

Has anyone run into this recently? Is there a setting in IIS Express, firewall, or Visual Studio that could be blocking the page from loading? I’d love to know how to fix this and finally see my hit counter working 💡

Thanks in advance!

—Jordan

Developer technologies | Visual Studio | Debugging
{count} votes

1 answer

Sort by: Most helpful
  1. Varsha Dundigalla(INFOSYS LIMITED) 2,700 Reputation points Microsoft External Staff
    2025-10-27T07:36:06.95+00:00

    Thank you for reaching out.

    This error means the browser can’t connect to IIS Express even though the ASP.NET Web Forms app compiles successfully. Since you already tried deleting the .vs folder, rebuilding, and checking the port and start page, the problem is most likely in how Visual Studio is recognizing or hosting the project.

    1. Confirm the project type
    If you created the Web Forms project manually, Visual Studio might not treat it as a web application.
    Fix

    1. In Solution Explorer, right-click the project → Unload Project → Edit .csproj
    2. Inside the first , make sure these lines exist:
         <ProjectTypeGuids>
          {349c5851-65df-11da-9384-00065b846f21};
         {fae04ec0-301f-11d3-bf4b-00c04f79efbc} 
         </ProjectTypeGuids> 
         <OutputType>Library</OutputType>
      
    3. Save, reload the project, rebuild, and run again.
      Without those GUIDs, Visual Studio will compile the code but not launch IIS Express to host it, which produces the “can’t reach page” message.

    2. Recreate IIS Express configuration
    Instead of deleting files again, reset IIS Express cleanly so Visual Studio rebuilds its configuration.

    1. Close Visual Studio.
    2. Rename (do not delete):
      • .vs.vs_backup in your project folder
        • C:\Users\<you>\Documents\IISExpressIISExpress_backup
    3. Re-open the project.
    4. Open Project → Properties → Web, choose Create Virtual Directory, save, and run.
      This forces Visual Studio to regenerate a fresh applicationhost.config with correct bindings.

    3. Switch to HTTP temporarily
    If your project URL begins with https://localhost:xxxx, change it to http://localhost:xxxx in Project → Properties → Web and run again.
    SSL certificate mismatches or expired developer certs can prevent IIS Express from starting.

    4. Verify the binding in applicationhost.config
    Open
    C:\Users\<you>\Documents\IISExpress\config\applicationhost.config
    and look under \ for your project entry:

    <binding protocol="http" bindingInformation="*:12345:localhost" />
    

    Confirm that the port matches the one in your project properties and that the physicalPath points to your project folder.

    5. Check for port conflicts
    Run in an elevated Command Prompt:

    netstat -ano | findstr :12345
    

    Replace 12345 with your port. If another process is using it, stop that process or choose a different port in Project → Properties → Web.

    6. Optional steps if it still fails

    • In Visual Studio Installer, open Modify → Individual Components and ensure ASP.NET and Web Development workload is installed.
    • If using HTTPS, reset local certificates:
    
    dotnet dev-certs https --clean dotnet dev-certs https --trust 
    

    Let me know if you need any further help with this. We'll be happy to assist.

    If you find this helpful, please mark this as "Accept Answer".

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.