Visual Studio For Mac Load Operation Failed Iis

Visual Studio For Mac Load Operation Failed Iis 7,5/10 7724 votes

Use the Visual Studio debugger to quickly find and fix bugs across languages. The Visual Studio for Mac debugger lets you step inside your code by setting Breakpoints, Step Over statements, Step Into and Out of functions, and inspect the current state of the code stack through powerful visualizations.

-->

By Sourabh Shirhatti

This article describes Visual Studio support for debugging ASP.NET Core apps running with IIS on Windows Server. This topic walks through enabling this scenario and setting up a project.

Prerequisites

  • ASP.NET and web development workload
  • .NET Core cross-platform development workload
  • X.509 security certificate (for HTTPS support)

Enable IIS

  1. In Windows, navigate to Control Panel > Programs > Programs and Features > Turn Windows features on or off (left side of the screen).
  2. Select the Internet Information Services check box. Select OK.

The IIS installation may require a system restart.

Configure IIS

IIS must have a website configured with the following:

  • Host name – Typically, the Default Web Site is used with a Host name of localhost. However, any valid IIS website with a unique host name works.
  • Site Binding
    • For apps that require HTTPS, create a binding to port 443 with a certificate. Typically, the IIS Express Development Certificate is used, but any valid certificate works.
    • For apps that use HTTP, confirm the existence of a binding to post 80 or create a binding to port 80 for a new site.
    • Use a single binding for either HTTP or HTTPS. Binding to both HTTP and HTTPS ports simultaneously isn't supported.

Enable development-time IIS support in Visual Studio

  1. Launch the Visual Studio installer.

  2. Select Modify for the Visual Studio installation that you plan to use for IIS development-time support.

  3. For the ASP.NET and web development workload, locate and install the Development time IIS support component.

    The component is listed in the Optional section under Development time IIS support in the Installation details panel to the right of the workloads. The component installs the ASP.NET Core Module, which is a native IIS module required to run ASP.NET Core apps with IIS.

Configure the project

HTTPS redirection

For a new project that requires HTTPS, select the check box to Configure for HTTPS in the Create a new ASP.NET Core Web Application window. Selecting the check box adds HTTPS Redirection and HSTS Middleware to the app when it's created.

For an existing project that requires HTTPS, use HTTPS Redirection and HSTS Middleware in Startup.Configure. For more information, see Enforce HTTPS in ASP.NET Core.

For a project that uses HTTP, HTTPS Redirection and HSTS Middleware aren't added to the app. No app configuration is required.

IIS launch profile

Create a new launch profile to add development-time IIS support:

  1. Right-click the project in Solution Explorer. Select Properties. Open the Debug tab.

  2. For Profile, select the New button. Name the profile 'IIS' in the popup window. Select OK to create the profile.

  3. For the Launch setting, select IIS from the list.

  4. Select the check box for Launch browser and provide the endpoint URL.

    When the app requires HTTPS, use an HTTPS endpoint (https://). For HTTP, use an HTTP (http://) endpoint.

    Provide the same host name and port as the IIS configuration specified earlier uses, typically localhost.

    Provide the name of the app at the end of the URL.

    For example, https://localhost/WebApplication1 (HTTPS) or http://localhost/WebApplication1 (HTTP) are valid endpoint URLs.

  5. In the Environment variables section, select the Add button. Provide an environment variable with a Name of ASPNETCORE_ENVIRONMENT and a Value of Development.

  6. In the Web Server Settings area, set the App URL to the same value used for the Launch browser endpoint URL.

  7. For the Hosting Model setting in Visual Studio 2019 or later, select Default to use the hosting model used by the project. If the project sets the <AspNetCoreHostingModel> property in its project file, the value of the property (InProcess or OutOfProcess) is used. If the property isn't present, the default hosting model of the app is used, which is in-process. If the app requires an explicit hosting model setting different from the app's normal hosting model, set the Hosting Model to either In Process or Out Of Process as needed.

  8. Save the profile.

When not using Visual Studio, manually add a launch profile to the launchSettings.json file in the Properties folder. The following example configures the profile to use the HTTPS protocol:

Confirm that the applicationUrl and launchUrl endpoints match and use the same protocol as the IIS binding configuration, either HTTP or HTTPS.

Run the project

Run Visual Studio as an administrator:

  • Confirm that the build configuration drop-down list is set to Debug.
  • Set the Start Debugging button to the IIS profile and select the button to start the app.

Visual Studio may prompt a restart if not running as an administrator. If prompted, restart Visual Studio.

If an untrusted development certificate is used, the browser may require you to create an exception for the untrusted certificate.

Note

Magic window 4k for windows. Debugging a Release build configuration with Just My Code and compiler optimizations results in a degraded experience. For example, break points aren't hit.

Additional resources

This article describes Visual Studio support for debugging ASP.NET Core apps running with IIS on Windows Server. This topic walks through enabling this scenario and setting up a project.

Prerequisites

  • ASP.NET and web development workload
  • .NET Core cross-platform development workload
  • X.509 security certificate (for HTTPS support)

Enable IIS

  1. In Windows, navigate to Control Panel > Programs > Programs and Features > Turn Windows features on or off (left side of the screen).
  2. Select the Internet Information Services check box. Select OK.

The IIS installation may require a system restart.

Configure IIS

IIS must have a website configured with the following:

  • Host name – Typically, the Default Web Site is used with a Host name of localhost. However, any valid IIS website with a unique host name works.
  • Site Binding
    • For apps that require HTTPS, create a binding to port 443 with a certificate. Typically, the IIS Express Development Certificate is used, but any valid certificate works.
    • For apps that use HTTP, confirm the existence of a binding to post 80 or create a binding to port 80 for a new site.
    • Use a single binding for either HTTP or HTTPS. Binding to both HTTP and HTTPS ports simultaneously isn't supported.

Enable development-time IIS support in Visual Studio

  1. Launch the Visual Studio installer.

  2. Select Modify for the Visual Studio installation that you plan to use for IIS development-time support.

  3. For the ASP.NET and web development workload, locate and install the Development time IIS support component.

    The component is listed in the Optional section under Development time IIS support in the Installation details panel to the right of the workloads. The component installs the ASP.NET Core Module, which is a native IIS module required to run ASP.NET Core apps with IIS.

Configure the project

HTTPS redirection

For a new project that requires HTTPS, select the check box to Configure for HTTPS in the Create a new ASP.NET Core Web Application window. Selecting the check box adds HTTPS Redirection and HSTS Middleware to the app when it's created.

For an existing project that requires HTTPS, use HTTPS Redirection and HSTS Middleware in Startup.Configure. For more information, see Enforce HTTPS in ASP.NET Core.

For a project that uses HTTP, HTTPS Redirection and HSTS Middleware aren't added to the app. No app configuration is required.

IIS launch profile

Create a new launch profile to add development-time IIS support:

  1. Right-click the project in Solution Explorer. Select Properties. Open the Debug tab.

  2. For Profile, select the New button. Name the profile 'IIS' in the popup window. Select OK to create the profile.

  3. For the Launch setting, select IIS from the list.

  4. Select the check box for Launch browser and provide the endpoint URL.

    When the app requires HTTPS, use an HTTPS endpoint (https://). For HTTP, use an HTTP (http://) endpoint.

    Provide the same host name and port as the IIS configuration specified earlier uses, typically localhost.

    Provide the name of the app at the end of the URL.

    For example, https://localhost/WebApplication1 (HTTPS) or http://localhost/WebApplication1 (HTTP) are valid endpoint URLs.

  5. In the Environment variables section, select the Add button. Provide an environment variable with a Name of ASPNETCORE_ENVIRONMENT and a Value of Development.

  6. In the Web Server Settings area, set the App URL to the same value used for the Launch browser endpoint URL.

  7. For the Hosting Model setting in Visual Studio 2019 or later, select Default to use the hosting model used by the project. If the project sets the <AspNetCoreHostingModel> property in its project file, the value of the property (InProcess or OutOfProcess) is used. If the property isn't present, the default hosting model of the app is used, which is out-of-process. If the app requires an explicit hosting model setting different from the app's normal hosting model, set the Hosting Model to either In Process or Out Of Process as needed.

  8. Save the profile.

When not using Visual Studio, manually add a launch profile to the launchSettings.json file in the Properties folder. The following example configures the profile to use the HTTPS protocol:

Confirm that the applicationUrl and launchUrl endpoints match and use the same protocol as the IIS binding configuration, either HTTP or HTTPS.

Run the project

Run Visual Studio as an administrator:

  • Confirm that the build configuration drop-down list is set to Debug.
  • Set the Start Debugging button to the IIS profile and select the button to start the app.

Visual Studio may prompt a restart if not running as an administrator. If prompted, restart Visual Studio.

If an untrusted development certificate is used, the browser may require you to create an exception for the untrusted certificate.

Note

Debugging a Release build configuration with Just My Code and compiler optimizations results in a degraded experience. For example, break points aren't hit.

Additional resources

-->

When you try to debug an ASP.NET application running on a Web server, you may get this error message: Unable to start debugging on the Web server.

Often, this error occurs because an error or configuration change has occurred that requires an update to your Application Pools, an IIS reset, or both. You can reset IIS by opening an elevated command prompt and typing iisreset.

Givenbelow Screenshot Displays Simple and Easy to use.Close Look at Mouse and Keyboard ActionsGiven below screenshot displays what all Mouse and Keyboard Actions as visible inthe Drop Down.Software TutorialLearning this Mac Application can be real fun and easy. Auto clicker mac book. Given below are 2 Different Clickers which can Click as You Would like to Auto Click & More at.Auto Clicker for Macintosh by MurGaa.comAutomate Mouse and Keyboard on your Mac Running 10.5 Onward on 64 Bit Version.

What is the detailed error message?

The Unable to start debugging on the Web server message is generic. Usually, a more specific message is included in the error string and that may help you identify the cause of the problem or search for a more exact fix. Here are a few of the more common error messages that are appended to the main error message:

IIS does not list a website that matches the launch url

  • Restart Visual Studio as an Administrator and retry debugging. (Some ASP.NET debugging scenarios require elevated privileges.)

    You can configure Visual Studio to always run as an Administrator by right-clicking the Visual Studio shortcut icon, choosing Properties > Advanced, and then choosing to always run as an Administrator.

The web server is not configured correctly

  • See Error: The web server is not configured correctly.

Unable to connect to the webserver

  • Are you running Visual Studio and the Web server on the same machine and debugging using F5 (instead of Attach to Process)? Open your project properties and make sure that the project is configured to connect to the correct Web server and launch URL. (Open Properties > Web > Servers or Properties > Debug depending on your project type. For a Web Forms project, open Property Pages > Start Options > Server.)

  • Otherwise, restart your Application Pool and then reset IIS. For more information, see Check your IIS Configuration.

The web server did not respond in a timely manner

  • Reset IIS and retry debugging. Multiple debugger instances may be attached to the IIS process; a reset terminates them. For more information, see Check your IIS Configuration.

The microsoft visual studio remote debugging monitor(msvsmon.exe) does not appear to be running on the remote computer

  • If you are debugging on a remote machine, make sure you have installed and are running the remote debugger. If the message mentions a firewall, make sure the correct ports in the firewall are open, especially if you are using a third party firewall.
  • If you are using a HOSTS file, make sure it is configured correctly. For example, if debugging using F5 (instead of Attach to Process), the HOSTS file needs to include the same project URL as in your project properties, Properties > Web > Servers or Properties > Debug, depending on your project type.

The remote server returned an error

Check your IIS log file for error subcodes and additional information, and this IIS 7 blog post.

In addition, here are some of the common error codes and a few suggestions.

  • (403) Forbidden. There are many possible causes for this error, so check your log file and the IIS security settings for the web site. Make sure the server's web.config includes debug=true in the compilation element. Make sure that your Web Application folder has the right permissions and that your Application Pool configuration is correct (a password may have changed). See Check your IIS Configuration. If these settings are already correct and you are debugging locally, also verify that you are connecting to the correct server type and URL (in Properties > Web > Servers or Properties > Debug, depending on your project type).
  • (503) Server Unavailable. The Application Pool may have stopped due to an error or configuration change. Restart the Application Pool.
  • (404) Not Found. Make sure that the Application Pool is configured for the correct version of ASP.NET.

Could not start ASP.NET debugging

  • Restart the Application Pool and reset IIS. For more information, see Check your IIS Configuration.
  • If you are doing URL rewrites, test a basic web.config with no URL rewrites. See the Note about the URL Rewrite Module in Check your IIS Configuration.

The debugger cannot connect to the remote computer

If you are debugging locally, open your project properties in Visual Studio and make sure that the project is configured to connect to the correct Web server and URL. (Open Properties > Web > Servers or Properties > Debug depending on your project type.)

This error may occur when debugging locally because Visual Studio is a 32-bit application, so it uses the 64-bit version of the remote debugger to debug 64-bit applications. Check your App Pool on IIS to make sure that Enable 32-bit applications is set to true, restart IIS, and try again.

Also, if you are using a HOSTS file, make sure it is configured correctly. For example, the HOSTS file needs to include the same project URL as in your project properties, Properties > Web > Servers or Properties > Debug, depending on your project type.

See help for common configuration errors. Running the webpage outside of the debugger may provide further information.

  • Are you running Visual Studio and the Web server on the same machine? Open your project properties and make sure that the project is configured to connect to the correct Web server and launch URL. (Open Properties > Web > Servers or Properties > Debug depending on your project type.)

  • If that does not work or you are debugging remotely, follow steps in Check your IIS Configuration.

Operation not supported. Unknown error: errornumber

If you are doing URL rewrites, test a basic web.config with no URL rewrites. See the Note about the URL Rewrite Module in Check your IIS Configuration.

Check your IIS configuration

After taking steps detailed here to resolve the issue, and before trying again to debug, you may also need to reset IIS. You can do that by opening an elevated command prompt and typing iisreset.

  • Stop and restart your IIS Application Pools, then retry.

    The Application Pool may have stopped as a result of an error. Or, another configuration change that you made may require that you stop and restart your Application Pool.

    Note

    If the Application Pool keeps stopping, you may need to uninstall the URL Rewrite Module from the Control Panel. You can reinstall it using the Web Platform Installer (WebPI). This issue may occur after a significant system upgrade.

  • Check your Application Pool configuration, correct it if needed, and then retry.

    The Application Pool may be configured for a version of ASP.NET that does not match your Visual Studio project. Update the ASP.NET version in the Application Pool and restart it. For detailed information, see IIS 8.0 Using ASP.NET 3.5 and ASP.NET 4.5.

    Also, if password credentials have changed, you may need to update them in your Application Pool or Web site. In the Application Pool, update credentials in Advanced Settings > Process Model > Identity. For the Web site, update credentials in Basic Settings > Connect as... 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.

  • Make sure that the correct version of ASP.NET is installed on IIS.

    Mismatched versions of ASP.NET on IIS and in your Visual Studio project may cause this issue. You may need to set the framework version in web.config. To install ASP.NET on IIS, use the Web Platform Installer (WebPI). Also, see IIS 8.0 Using ASP.NET 3.5 and ASP.NET 4.5 or, for ASP.NET Core, Host on Windows with IIS.

  • Resolve authentication errors if you are using only the IP address

    By default, IP addresses are assumed to be part of the Internet, and NTLM authentication is not done over the Internet. If your web site is configured in IIS to require authentication, this authentication fails. To correct this problem, you can specify the name of the remote computer instead of the IP address.

Other causes

If the IIS configuration is not causing the issue, try these steps:

  • Restart Visual Studio with Administrator privileges and try again.

    Some ASP.NET debugging scenarios such as using Web Deploy require elevated privileges for Visual Studio.

  • If multiple instances of Visual Studio are running, reopen your project in one instance of Visual Studio (with Administrator privileges), and try again.

  • If you are using a HOSTS file with local addresses, try using the loopback address instead of the machine's IP address.

    If you are not using local addresses, make sure your HOSTS file includes the same project URL as in your project properties, Properties > Web > Servers or Properties > Debug, depending on your project type.

More troubleshooting steps

  • Bring up the localhost page in the browser on the server.

    If IIS is not installed correctly, you should get errors when you type http://localhost in a browser.

    For more information on deploying to IIS, see IIS 8.0 Using ASP.NET 3.5 and ASP.NET 4.5 and, for ASP.NET Core, Host on Windows with IIS.

  • Create a basic ASP.NET application on the server (or use a basic web.config file).

    If you can't get your app to work with the debugger, try creating a basic ASP.NET application locally on the server, and try to debug the basic app. (You might want to use the default ASP.NET MVC template.) If you can debug a basic app, that may help you identify what's different between the two configurations. Look for differences in settings in the web.config file, such as URL rewrite rules.

See also