Deploying ASP.NET Framework 4.x Applications Print

  • 0

Overview

This guide covers deploying classic ASP.NET Framework applications (Web Forms, MVC 5, Web API 2) to your Windows hosting. These applications use the .NET Framework 4.x runtime, not .NET Core/.NET 10.

Supported Versions

  • .NET Framework 4.5, 4.6, 4.7, 4.8
  • ASP.NET Web Forms
  • ASP.NET MVC 3, 4, 5
  • ASP.NET Web API 1, 2
  • WCF Services

Publishing Your Application

From Visual Studio:

  1. Right-click your project → Publish
  2. Select Folder as target
  3. Choose a local folder path
  4. Click Publish

Important Settings:

  • Configuration: Release
  • Target Framework: Should match your project
  • Precompile during publishing: Recommended for production

Uploading to Plesk

Option 1: File Manager

  1. Log in to Plesk
  2. Go to Websites & DomainsFile Manager
  3. Navigate to httpdocs
  4. Upload all files from your publish folder

Option 2: FTP

  1. Connect using FTP credentials from Plesk
  2. Navigate to /httpdocs
  3. Upload all files from your publish folder
  4. Use binary mode for DLL files

Configuring ASP.NET in Plesk

Set ASP.NET Version:

  1. Go to Websites & Domains
  2. Select your domain
  3. Click Hosting Settings
  4. Under ASP.NET, select appropriate version
  5. Click OK

Or via ASP.NET Settings:

  1. Go to Websites & Domains
  2. Click ASP.NET Settings
  3. Configure application-specific settings

Web.config Configuration

Basic Web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <connectionStrings>
    <add name="DefaultConnection" 
         connectionString="Server=localhost;Database=mydb;User Id=myuser;Password=mypass;" 
         providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
    <compilation debug="false" targetFramework="4.8" />
    <httpRuntime targetFramework="4.8" />
    <customErrors mode="RemoteOnly" defaultRedirect="/Error" />
  </system.web>
</configuration>

Important Settings:

  • debug="false": Always use false in production
  • customErrors: Hide detailed errors from public
  • targetFramework: Match your application version

Common File Structure

httpdocs/
├── bin/                 (compiled DLLs)
├── Content/            (CSS, images)
├── Scripts/            (JavaScript)
├── Views/              (MVC views)
├── Global.asax
├── Web.config
└── Default.aspx        (or other entry point)

Troubleshooting

Yellow Screen of Death (YSOD)

  • Check Web.config for syntax errors
  • Verify all DLLs are in the bin folder
  • Check application event logs

HTTP 500 - Internal Server Error

  1. Temporarily set customErrors mode="Off"
  2. Refresh to see detailed error
  3. Fix the issue
  4. Set customErrors mode="RemoteOnly" again

Missing DLL Errors

  • Ensure all referenced DLLs are in the bin folder
  • Use "Copy Local = True" for NuGet packages
  • Publish with all dependencies included

Database Connection Failed

  • Use localhost for server name
  • Verify credentials match Plesk database settings
  • Check connection string syntax

Application Pool Considerations

Your ASP.NET Framework app runs in an IIS Application Pool configured for .NET 4.x. If you experience issues:

  • Contact support to verify pool settings
  • Integrated pipeline mode is recommended
  • 32-bit vs 64-bit may affect some applications

Security Best Practices

  • Set debug="false" in production
  • Use customErrors to hide detailed errors
  • Store connection strings securely
  • Keep .NET Framework updated
  • Use HTTPS for all traffic

Was this answer helpful?

« Back