Skip to main content

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_erp site 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

  1. Visual Studio publishes a self-contained folder (see MVC_PUBLISH.pubxml).
  2. You copy that folder to C:\inetpub\wwwroot\damsy_erp.
  3. IIS maps the URL to that physical path and runs it under an application pool.
  4. The pool's Windows identity (IIS APPPOOL\<PoolName>) must have database access when using integrated security.

Prerequisites

RequirementNotes
Published Release buildFrom profile MVC_PUBLISH
IIS with ASP.NET 4.xInstall Web Server (IIS) + ASP.NET 4.8 (or 4.5+) features
SQL Server reachable from serverConnection string updated on server Web.config
Crystal Reports runtimeRequired 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):

  1. Stop the site or app pool if replacing a live deployment (optional but avoids file locks).
  2. Copy all contents to:
C:\inetpub\wwwroot\damsy_erp\
  1. Preserve the server Web.config connection strings if you are overlaying files — see Release configuration.
warning

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

  1. Open IIS ManagerApplication Pools.
  2. Create a pool (or reuse an existing one), for example DamsyERP.
  3. Set .NET CLR version to v4.0.
  4. Set Managed pipeline mode to Integrated.
  5. 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

  1. SitesAdd Website
  2. Site name: Damsy ERP
  3. Physical path: C:\inetpub\wwwroot\damsy_erp
  4. Binding: HTTP port 80 (or HTTPS when SSL is ready)
  5. Application pool: DamsyERP

Option B — Application under Default Web Site

  1. Expand Default Web SiteAdd Application
  2. Alias: damsy_erp
  3. Physical path: C:\inetpub\wwwroot\damsy_erp
  4. 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:

  1. IIS Manager → Application Pools → select DamsyERP
  2. Recycle (or StopStart)

This loads new assemblies, refreshes Web.config, and clears in-memory session state.

Step 6 — Verify the deployment

CheckExpected
Browse to site URLLogin page with company dropdown
app-assets/css/shell-modern.cssHTTP 200, not 404
Login with seed credentialsRedirect to Dashboard (if DB seeded)
IIS logsNo 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.

Important notes

  • Windows auth identity: The effective SQL login is IIS APPPOOL\<ApplicationPoolName>, not the human admin account used in SSMS.
  • HTTPS: Keep ForceHttps=false and requireSSL=false until 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_IUSRS and the app pool identity need Read & execute on the site folder.

Common mistakes

MistakeResult
Forgetting to recycle app pool after deployOld DLLs or config cached
SQL login for wrong pool name"Login failed for user IIS APPPOOL\..."
Deploying Debug build to IISSlower, verbose errors, wrong transforms
Enabling HTTPS redirect without SSL certRedirect loop or broken cookies
Omitting app-assets from copyUnstyled UI, broken layouts

Next steps

  1. Confirm Release settings on the server Web.config.
  2. Point MyConnectionString at your database — Connection strings.
  3. If the database is new, follow Blank database setup.
  4. Bookmark Troubleshooting for post-go-live issues.