Showing posts with label Windows Server. Show all posts
Showing posts with label Windows Server. Show all posts

April 27, 2026

Deploying .NET Core Web API to IIS on Windows Server (Fix HTTP 500.19 Error)

Introduction

Deploying a .NET Core Web API to IIS on Windows Server is a standard requirement in enterprise environments. However, many developers encounter deployment failures such as HTTP Error 500.19 (Error Code: 0x8007000d) immediately after publishing.

This error is rarely complex. It is almost always caused by missing prerequisites, incorrect IIS configuration, or an improperly installed Hosting Bundle.

This guide walks you through the complete IIS deployment process step-by-step - and explains exactly how to diagnose and resolve HTTP 500.19 errors with confidence.

Prerequisites

Before beginning deployment, ensure the following components are installed and ready:

  • Windows Server installed and accessible
  • IIS (Internet Information Services) installed and running
  • .NET Core / .NET Hosting Bundle installed (version must match your project)
  • Visual Studio project built successfully in Release mode
  • Published output folder generated and accessible

Important: The Hosting Bundle version must precisely match your target framework (.NET 6, 7, 8, etc.). A version mismatch is one of the most common root causes of HTTP Error 500.19.

01 Install IIS

Open Server ManagerAdd Roles and Features → Select Role-based installation → Choose your server → Select Web Server (IIS).

During feature selection, ensure the following are included:

  • Web Server (IIS)
  • Application Development Features
  • .NET Extensibility
  • ASP.NET Core Module (if available)
  • Management Tools
  • IIS Management Console

Command - Verify IIS Manager

inetmgr

Run this command in the Run dialog (Win + R) to confirm IIS Manager opens successfully.

02 Install .NET Core Hosting Bundle

Download the Hosting Bundle from the official Microsoft .NET download page and install the version that precisely matches your project's target framework. Running a mismatched version is a leading cause of 500.19 errors and should be verified before any other troubleshooting.

Command - Restart IIS After Installation

iisreset

After installation, always restart IIS to ensure the .NET Core Module is properly registered.

03 Select Publish Target

  • Right-click your project in Solution Explorer → Click Publish
  • Select Folder as the publish target → Click Next
  • Provide a publish path, e.g.: C:\Users\YourName\Desktop\PublishedFolder
  • Click Finish to save the publish profile

04 Publish the Web API

  • Set Configuration to Release
  • Set Deployment Mode to Framework-dependent
  • Confirm Target Framework matches your project version
  • Enable Delete all existing files prior to publish to avoid stale artifacts
  • Click Publish and wait for the process to complete

Once published, copy the output folder to the IIS web root directory:

C:\inetpub\wwwroot\MyWebApi

05 Create Application Pool

  • Open IIS Manager → Click Application Pools
  • Click Add Application Pool in the Actions panel
  • Name: MyApiPool
  • .NET CLR Version: No Managed Code (required for all .NET Core apps)
  • Managed Pipeline Mode: Integrated

Setting the .NET CLR Version to No Managed Code is critical. .NET Core manages its own runtime independently and does not rely on the IIS CLR. Selecting a CLR version here will cause application pool startup errors.

06 Create Website in IIS

  • In IIS Manager, right-click Sites → Click Add Website
  • Site Name: MyWebApi
  • Physical Path: point to your published output folder
  • Application Pool: select MyApiPool (created in Step 05)
  • Binding Port: 80 (or a custom port such as 5000)
  • Click OK to create the site

07 Configure Windows Firewall (For Custom Ports)

If your IIS website is configured to use a custom port (e.g., 5000), you must create an inbound firewall rule to allow traffic on that port. Without this step, external requests will be blocked silently by Windows Firewall.

  • Press Win + R, type wf.msc, and press Enter
  • Click Inbound RulesNew Rule
  • Select Port as the rule type → Click Next
  • Choose TCP and enter 5000 under Specific local ports
  • Select Allow the connection → Click Next
  • Apply to profiles: Domain, Private, and Public
  • Name the rule MyWebApi Port 5000 → Click Finish

After the rule is created, verify connectivity by navigating to:

http://your-server-ip:5000

Common Issue: HTTP Error 500.19 - Internal Server Error

Error Code: 0x8007000d  |  HTTP Status: 500.19 – Internal Server Error

This error consistently points to one of the following root causes:

  • Hosting Bundle not installed - or the version does not match the target framework
  • Corrupted or invalid web.config - IIS cannot parse the configuration file
  • Missing AspNetCoreModuleV2 - module not registered after Hosting Bundle installation
  • Incorrect Application Pool configuration - CLR version not set to No Managed Code

Diagnosis Tip: After each corrective action, run iisreset from an elevated command prompt and re-test. Most 500.19 errors resolve after reinstalling the correct Hosting Bundle version followed by an IIS restart.

Conclusion

The majority of HTTP 500.19 errors are environment configuration issues - not application code problems. By correctly installing IIS, precisely matching the Hosting Bundle version to your target framework, setting the Application Pool to No Managed Code, and opening the required ports in Windows Firewall, you can deploy your .NET Core Web API reliably and predictably on any Windows Server environment.

Follow these steps in sequence, validate each stage before proceeding to the next, and run iisreset after any configuration change to ensure changes take effect immediately.

April 10, 2025

Restoring Windows Server from Backup – Bare Metal and Active Directory Recovery

Windows Server Backup Guide

Introduction

If your server crashes or Active Directory becomes corrupt, restoring from backup ensures minimal downtime. This guide explains the steps for Bare Metal Recovery and System State recovery.

📂 If you haven't created a backup yet, start with our Windows Server Backup Guide

Bare Metal Recovery (BMR) Steps

  1. Prepare a Windows bootable USB drive and insert it.
  2. Follow the on-screen instructions to configure language, time, and keyboard, then click Next.
  3. Select Repair your computer.
  4. Select Troubleshoot.
  5. Select Advanced options.
  6. Select System Image Recovery.
  7. Select your backup path (for demo purposes, we select a local drive), then click Next.
  8. Choose Additional restore options and click Next.
  9. Click Finish.
  10. Confirm that all disks will be formatted and replaced by clicking Yes.
  11. The restoring process begins.
  12. After the restoration process is complete, the system will automatically restart.
  13. After restart, log in using a Domain Administrator account.
  14. The restoration process completes, restoring the entire server, including the OS, system state, installed applications, and data.

System State Backup Restore (Active Directory)

  1. Launch Server Manager, navigate to Tools, select Windows Server Backup, and click Recover.
  2. Select your backup location and click Next.
  3. Choose the backup date and click Next.
  4. Select System State as the recovery type, then click Next.
  5. Select the location for system state recovery and click Next.
  6. Log into Active Directory Repair Mode and access it via DSRM authentication when prompted.

Note: Before restarting, ensure Active Directory Repair Mode is enabled and DSRM authentication is set up. If not, refer to the guide on resetting the DSRM password.

DSRM Authentication Password Reset

Before you reset the DSRM password, note that DSRM refers to the NTDS password set during domain server creation.

Reset Password using PowerShell Command Prompt

Open PowerShell as administrator and execute the following commands:

 ntdsutil  
 set dsrm password  
 reset password on server null  
  • Enter your password and confirm it.
  • Password has been set successfully.
  • Type q (quit) twice to exit.
  • DSRM password has been successfully reset.

Enable Active Directory Repair Mode

  • Open the Run command: msconfig
  • Navigate to Boot tab
  • Check Safe boot and Active Directory Repair

Restart your system and press F8.

Select Directory Services Repair Mode

Enter the DSRM administrator authentication password set above.

Windows Server Backup and Recovery

  • Launch Server Manager
  • Navigate to ToolsWindows Server Backup
  • Click on Recover
  • Select the backup date, time, and location.
  • Choose System State and click Next.
  • Select Original Location and confirm.
  • Click Recover and then Yes. Recovery progress starts.

Disable Active Directory Repair Mode

  • Open Run: msconfig
  • Go to the Boot tab and uncheck Safe boot

Final Steps

  • Log in using your domain name and administrator account.
  • Confirm that system recovery has been completed successfully.
  • Check if Active Directory Users, OUs, Groups, etc., have been restored.

Troubleshooting

During the in-place upgrade of Windows Server, two issues may encounter:

FSMO (Flexible Single Master Operations)

An FSMO role error occurred, where the FSMO role was incorrectly identified. To resolve:

  • Go to Active Directory Users and Computers
  • Navigate to Domain Controller
  • Right-click on the incorrect FSMO role and delete it.

Run the following command to check FSMO roles:

netdom query fsmo














Hyper-V Issue

After upgrading, virtual machines lost internet connectivity. The solution is to reinstall the Hyper-V role.

Windows Server Backup – Step-by-Step Guide to Safeguard Your System

Windows Server Backup Guide

Introduction

Data loss can be catastrophic for any organization, making a reliable backup and restore strategy essential for maintaining business continuity. Windows Server provides built-in tools to help administrators safeguard critical data.

In this guide, we’ll walk you through setting up Windows Server Backup, creating different types of backups, and best practices to ensure your system is secure and resilient.

⚠️ Need help with restoring data? Check out our restore guide here: How to Restore Windows Server from Backup?

Pre-requisites

  • Microsoft Server 2012/2016/2019/2022
  • Administrator Role via Server Manager
  • Resilient Storage (Local/Remote)

Backup Guide Steps

This backup guide is divided into four main steps:

  • Windows Server Backup
  • Restore Bare Metal Recovery Backup
  • Restore System State Backup
  • Troubleshooting

Windows Server Backup

Follow these steps to configure Windows Server Backup:

  1. Open Server Manager, select Tools, and then select Windows Server Backup.
  2. Select Local Backup.
  3. On the Action menu, select Backup once.
  4. In the Backup Once Wizard, on the Backup options page, select Different options, and then select Next.
  5. On the Select Backup Configuration page, choose one of the following:
    • Full Server: Backs up the entire system.
    • Custom: Select Bare metal recovery for a full system restore, including critical items.
    • System State: If you want to back up Active Directory.
  6. Click on Advanced Settings.
  7. Click on VSS settings and select VSS Full Backup.
  • What is Bare Metal Recovery

  • Bare Metal Recovery (BMR) is a feature in Windows Server Backup that allows for a complete server restoration in case of catastrophic failure.

    This process restores the entire system, including:

    • Operating System
    • System State
    • Installed Applications
    • Data
  • What is System State Backup

  • A System State backup includes essential components:

    • Active Directory database (on domain controllers)
    • System Registry
    • COM+ Class Registration database
    • Boot files
    • Performance Counters configuration
    • Cluster service information (on clustered servers)
    • Certificate Services database (if installed)
    • IIS Metabase (if installed)
    • System files protected by Windows File Protection

    A System State backup is often a prerequisite for Bare Metal Recovery (BMR) or Active Directory recovery.

Backup Destination

  1. On the Specify destination type page, select Local drives or Remote shared folder, and click Next.
  2. On the Select Backup Destination page, choose a backup location.
  3. On the confirmation screen, click Backup.
  4. Once completed, close Windows Server Backup.

🔄 Ready to recover your server? Head to Part 2: Restore Guide for Windows Server Backup