IIS Deployment
Deploy nopCommerce to Windows Server with IIS.
Prerequisites
- Windows Server 2019 or later
- IIS installed with required features
- .NET 8.0 Hosting Bundle installed
- SQL Server accessible
Step 1: Install IIS Features
powershell
# Run in PowerShell as Administrator
Install-WindowsFeature -Name Web-Server -IncludeManagementTools
Install-WindowsFeature -Name Web-Asp-Net45
Install-WindowsFeature -Name Web-Net-Ext45
Install-WindowsFeature -Name Web-ISAPI-Ext
Install-WindowsFeature -Name Web-ISAPI-Filter
Install-WindowsFeature -Name Web-Http-Redirect
Install-WindowsFeature -Name Web-Dyn-CompressionStep 2: Install .NET Hosting Bundle
Download from: https://dotnet.microsoft.com/download/dotnet/8.0
Restart IIS
After installing the hosting bundle, restart IIS:
iisresetStep 3: Prepare Application Files
- Publish nopCommerce:
bash
dotnet publish src/Presentation/Nop.Web -c Release -o ./publishCopy to server (e.g.,
C:\inetpub\wwwroot\nopCommerce)Set folder permissions:
powershell
icacls "C:\inetpub\wwwroot\nopCommerce" /grant "IIS_IUSRS:(OI)(CI)M"Step 4: Create IIS Site
- Open IIS Manager
- Right-click Sites → Add Website
- Configure:
- Site name:
nopCommerce - Physical path:
C:\inetpub\wwwroot\nopCommerce - Binding: Host name, Port 443, SSL certificate
- Site name:
Step 5: Configure Application Pool
- Select the Application Pool
- Set:
- .NET CLR Version: No Managed Code
- Managed Pipeline Mode: Integrated
- Start Mode: AlwaysRunning (optional)
Step 6: Configure web.config
xml
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*"
modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet"
arguments=".\Nop.Web.dll"
stdoutLogEnabled="false"
hostingModel="InProcess" />
</system.webServer>
</configuration>Troubleshooting
500.19 Error
- Check file permissions
- Verify .NET Hosting Bundle installed
502.5 Error
- Check
stdoutLogEnabled="true"in web.config - Review logs in
.\logs\folder
Database Connection Failed
- Verify SQL Server is accessible
- Check connection string in
App_Data\dataSettings.json