I can not use iis Express

弘善 飯田 0 Reputation points
2024-11-21T13:08:14.6466667+00:00

I am experiencing issues where a message stating "Failed to run IIS" occurs on two different PCs. Here are the details:

Environment Information

  • OS: Windows 11 24H2 (OS Build: 26100.2033)
  • Visual Studio: Visual Studio 2022 Professional (Version 17.12.1)
  • Goal: Developing a VB.NET project with Framework 4.7.2

Problem Description

  • When debugging a web project, a message stating "Failed to run IIS" appears.
  • Upon trying to debug again, IIS does not launch, and attempting to open localhost results in no page being displayed.
  • However, Form Applications work without any issues.

Troubleshooting Attempts

  1. Running Visual Studio as an administrator
  2. Deleting IIS Express-related files and running again
  3. Repairing Visual Studio 2022
  4. Reinstalling Visual Studio 2022

Questions

  1. What could be causing this issue to occur on both PCs?
  2. Could you provide specific solutions to resolve this problem?I am experiencing issues where a message stating "Failed to run IIS" occurs on two different PCs. Here are the details: Environment Information
    • OS: Windows 11 24H2 (OS Build: 26100.2033)
    • Visual Studio: Visual Studio 2022 Professional (Version 17.12.1)
    • Goal: Developing a VB.NET project with Framework 4.7.2
    Problem Description
    • When debugging a web project, a message stating "Failed to run IIS" appears.
    • Upon trying to debug again, IIS does not launch, and attempting to open localhost results in no page being displayed.
    • However, Form Applications work without any issues.
    Troubleshooting Attempts
    1. Running Visual Studio as an administrator
    2. Deleting IIS Express-related files and running again
    3. Repairing Visual Studio 2022
    4. Reinstalling Visual Studio 2022
    Questions
    1. What could be causing this issue to occur on both PCs?
    2. Could you provide specific solutions to resolve this problem?
Internet Information Services
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,230 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,743 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2024-11-21T13:08:14.65+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The "Failed to run IIS" message can be caused by several factors, especially when it occurs on multiple PCs. Here are some potential causes and solutions:

    1. IIS Configuration Issues: Ensure that IIS is properly installed and configured on both PCs. You can check this by going to "Turn Windows features on or off" and confirming that IIS is enabled.
    2. Web.config File: If your project has a malformed or missing web.config file, it can cause issues with IIS Express. Make sure that the web.config file is present and correctly configured in your project.
    3. Port Conflicts: Check if the port that IIS Express is trying to use is already in use by another application. You can change the port in the project properties under the "Web" section.
    4. Permissions: Even though you have run Visual Studio as an administrator, ensure that the user account has the necessary permissions to run IIS Express.
    5. Corrupted IIS Express Installation: Since you've already deleted IIS Express-related files, you might want to consider reinstalling IIS Express separately to ensure it is not corrupted.
    6. Firewall or Antivirus Interference: Sometimes, firewall or antivirus software can block IIS Express from running. Temporarily disable them to see if that resolves the issue.
    7. Check Event Viewer: Look for any relevant error messages in the Windows Event Viewer under "Windows Logs" > "Application" that may provide more insight into why IIS is failing to start.

    If these steps do not resolve the issue, consider checking the Visual Studio logs for more detailed error messages.


    References:

    0 comments No comments

  2. XuDong Peng-MSFT 10,761 Reputation points Microsoft Vendor
    2024-11-22T02:13:02.5833333+00:00

    Hi @弘善 飯田,

    I am experiencing issues where a message stating "Failed to run IIS" occurs on two different PCs.

    This problem is usually caused by many possible reasons. Can you provide more detailed error messages? Such as its detailed error message, or error code(like 0x80070005, 0x800700b7 or something else).

    Deleting IIS Express-related files and running again

    Are you referring to the folder in the path "C:\Users<username>\Documents\IISExpress"? You can also try to delete the .vs folder under the project root path (it is hidden by default).

    In addition, you can also try the following methods:

    1. Delete .vs\config\applicationhost.config file, then right click on prject solution -> properties -> debug tab ->web server settings, change port number to be different from all other applications. Restart VS and rebuild solution.
    2. Try to create an empty asp.net or asp.net core application and run it in IIS Express directly. Check if there is same issue.

    Best regards,

    Xudong Peng


    If the answer is the right solution, please click "Accept Answer" and kindly upvote. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

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