Overview
MasterLabel is an ASP.NET Core 8.0 web application that can be deployed to various hosting environments including IIS, Kestrel (standalone), or containerized platforms.Requirements
Runtime Requirements
- .NET 8.0 Runtime: ASP.NET Core Runtime 8.0 or later
- Operating System: Windows Server 2016+, Linux, or macOS
- SQL Server: LocalDB (development), SQL Server Express, or SQL Server (any edition)
- Web Server: IIS 10+ (Windows) or Kestrel (cross-platform)
Dependencies
The application requires the following NuGet package:System.Data.SqlClientv4.9.0 (included in build)
The .NET 8.0 SDK is only required for building the application. Production servers only need the ASP.NET Core Runtime.
Build and Publish
Deployment Options
Option 1: IIS Deployment (Windows)
Install Prerequisites
Install the ASP.NET Core Hosting Bundle on the IIS server:
- Download the .NET 8.0 Hosting Bundle
- Run the installer
- Restart IIS:
iisreset
Create IIS Application
Configure IIS to host the application:
- Open IIS Manager
- Create a new Application Pool:
- Name:
MasterLabelAppPool - .NET CLR Version: No Managed Code
- Managed Pipeline Mode: Integrated
- Name:
- Create a new Website or Application:
- Physical Path:
C:\\inetpub\\masterlabel - Application Pool:
MasterLabelAppPool - Binding: HTTP on port 80 (or HTTPS on 443)
- Physical Path:
Configure Permissions
Grant the Application Pool identity access to the application folder and database:
Option 2: Kestrel Standalone (Cross-Platform)
Run as a Service
Windows Service:Linux systemd Service:Create Enable and start the service:
/etc/systemd/system/masterlabel.service:Environment Configuration
Configuration Files
MasterLabel uses a hierarchical configuration system:- appsettings.json - Base configuration (checked into source control)
- appsettings.Development.json - Development overrides
- appsettings.Production.json - Production overrides
- Environment Variables - Highest priority (recommended for secrets)
Setting Environment Variables
Windows (IIS):Production Considerations
Security Checklist
- Connection strings stored in environment variables or Key Vault
- HTTPS enabled with valid SSL certificate
- SQL Server access restricted to application server IP
- Windows/SQL authentication properly configured
- Application pool identity has minimum required permissions
-
appsettings.Production.jsonexcluded from source control - Error pages do not expose sensitive information
Performance Optimization
- Enable response compression
- Configure caching policies for static assets
- Set appropriate database connection pool size
- Monitor application performance and logs
- Set up health check endpoints
Monitoring and Logs
By default, logs are written to the console. In production, configure logging to persistent storage:For IIS deployments, enable the ASP.NET Core Module log to troubleshoot startup issues. Check
C:\\inetpub\\logs\\stdout for stdout logs.Updating the Application
To update the application:- Stop the application (stop IIS site or systemd service)
- Backup the current version (optional but recommended)
- Copy new published files to the application directory
- Verify configuration files are preserved
- Start the application and verify it’s running
Troubleshooting
Application Won’t Start
- Check the event logs (Windows) or systemd journal (Linux)
- Verify .NET 8.0 runtime is installed
- Check file permissions on application directory
- Validate connection string syntax
- Ensure database is accessible from application server
Database Connection Errors
- Verify SQL Server is running and accessible
- Test connection string using
sqlcmd - Check firewall rules between app and database servers
- Verify SQL Server authentication mode matches connection string
500 Internal Server Error
- Enable detailed error pages temporarily (set
ASPNETCORE_ENVIRONMENT=Development) - Check application logs for exceptions
- Verify all required files were deployed
- Check IIS Application Pool is running