Deploy to IIS
This guide covers hosting a published Damsy ERP build on Internet Information Services (IIS) on Windows Server or Windows 10/11 Pro. The typical production path is C:\inetpub\wwwroot\damsy_erp.
Introduction
Damsy ERP is an ASP.NET MVC 5 application targeting .NET Framework 4.5.2. IIS serves the site as a file-system deployment: compiled assemblies, Razor views, static assets under app-assets, and Crystal Report viewer files. The site connects to SQL Server using connection strings in the deployed Web.config.
Purpose
Move a verified Release publish folder onto a Windows web server, configure IIS so the application pool identity can reach SQL Server, and confirm the site loads without redirect loops or missing static files.
When to use
Use this guide when:
- Deploying to a VPS, on-premises server, or dedicated IIS machine
- Replacing an existing
damsy_erpsite with a new build - Setting up a staging environment that mirrors production IIS settings
For building the publish output itself, start with Publish the application and Release configuration.
How it works
- Visual Studio publishes a self-contained folder (see
MVC_PUBLISH.pubxml). - You copy that folder to
C:\inetpub\wwwroot\damsy_erp. - IIS maps the URL to that physical path and runs it under an application pool.
- The pool's Windows identity (
IIS APPPOOL\<PoolName>) must have database access when using integrated security.
Prerequisites
| Requirement | Notes |
|---|---|
| Published Release build | From profile MVC_PUBLISH |
| IIS with ASP.NET 4.x | Install Web Server (IIS) + ASP.NET 4.8 (or 4.5+) features |
| SQL Server reachable from server | Connection string updated on server Web.config |
| Crystal Reports runtime | Required for report viewers — see Troubleshooting |
Step-by-step — IIS deployment
Step 1 — Copy the publish folder
After a successful publish (local output example: C:\Users\Thinkpad\Music\Publish\damsy_erp):
- Stop the site or app pool if replacing a live deployment (optional but avoids file locks).
- Copy all contents to:
C:\inetpub\wwwroot\damsy_erp\
- Preserve the server
Web.configconnection strings if you are overlaying files — see Release configuration.
Do not copy only bin and Views. Static CSS, JS, Crystal viewer scripts, and Area partial views must be present or pages fail at runtime.
Step 2 — Create or configure the application pool
- Open IIS Manager → Application Pools.
- Create a pool (or reuse an existing one), for example
DamsyERP. - Set .NET CLR version to v4.0.
- Set Managed pipeline mode to Integrated.
- Identity: start with ApplicationPoolIdentity (creates
IIS APPPOOL\DamsyERP).
For SQL Server Windows Authentication, grant the pool identity access to the database (see Step 4).
Step 3 — Create or point the website / application
Option A — Dedicated site
- Sites → Add Website
- Site name:
Damsy ERP - Physical path:
C:\inetpub\wwwroot\damsy_erp - Binding: HTTP port 80 (or HTTPS when SSL is ready)
- Application pool:
DamsyERP
Option B — Application under Default Web Site
- Expand Default Web Site → Add Application
- Alias:
damsy_erp - Physical path:
C:\inetpub\wwwroot\damsy_erp - URL becomes
http://<server>/damsy_erp/
Ensure the default document or route resolves to Login (/Login/Index).
Step 4 — Grant SQL access to the app pool identity
When MyConnectionString uses Integrated Security (typical on VPS):
-- Run in SSMS against DB_DAMSYERP (adjust pool name)
CREATE LOGIN [IIS APPPOOL\DamsyERP] FROM WINDOWS;
USE [DB_DAMSYERP];
CREATE USER [IIS APPPOOL\DamsyERP] FOR LOGIN [IIS APPPOOL\DamsyERP];
ALTER ROLE db_datareader ADD MEMBER [IIS APPPOOL\DamsyERP];
ALTER ROLE db_datawriter ADD MEMBER [IIS APPPOOL\DamsyERP];
-- Many SPs need EXECUTE; db_owner is common on small VPS installs:
-- ALTER ROLE db_owner ADD MEMBER [IIS APPPOOL\DamsyERP];
Replace DamsyERP with your actual pool name.
Step 5 — Recycle the application pool
After every deploy:
- IIS Manager → Application Pools → select
DamsyERP - Recycle (or Stop → Start)
This loads new assemblies, refreshes Web.config, and clears in-memory session state.
Step 6 — Verify the deployment
| Check | Expected |
|---|---|
| Browse to site URL | Login page with company dropdown |
app-assets/css/shell-modern.css | HTTP 200, not 404 |
| Login with seed credentials | Redirect to Dashboard (if DB seeded) |
| IIS logs | No repeated 302 loops |
Hard-refresh the browser (Ctrl+F5) after CSS changes.
Examples
Example — Full path layout on VPS
C:\inetpub\wwwroot\damsy_erp\
├── bin\
├── Areas\
├── app-assets\
├── Views\
├── Web.config
├── Global.asax
└── crystalreportviewers13\
Example — Recycle from PowerShell (admin)
Import-Module WebAdministration
Restart-WebAppPool -Name "DamsyERP"
Example — Test static file
http://your-server/damsy_erp/app-assets/css/shell-modern.css
If this 404s, the publish was incomplete or files were not copied.
Related pages
- Publish the application
- Release configuration
- Database operations
- Blank database setup
- Troubleshooting overview
Important notes
- Windows auth identity: The effective SQL login is
IIS APPPOOL\<ApplicationPoolName>, not the human admin account used in SSMS. - HTTPS: Keep
ForceHttps=falseandrequireSSL=falseuntil a valid SSL certificate is bound — see Release configuration. - customErrors RemoteOnly: Users see friendly errors; connect to the server console or enable failed-request tracing to see yellow-screen details locally on the box.
- File permissions:
IIS_IUSRSand the app pool identity need Read & execute on the site folder.
Common mistakes
| Mistake | Result |
|---|---|
| Forgetting to recycle app pool after deploy | Old DLLs or config cached |
| SQL login for wrong pool name | "Login failed for user IIS APPPOOL\..." |
| Deploying Debug build to IIS | Slower, verbose errors, wrong transforms |
| Enabling HTTPS redirect without SSL cert | Redirect loop or broken cookies |
Omitting app-assets from copy | Unstyled UI, broken layouts |
Next steps
- Confirm Release settings on the server
Web.config. - Point
MyConnectionStringat your database — Connection strings. - If the database is new, follow Blank database setup.
- Bookmark Troubleshooting for post-go-live issues.