Deploy an ASP.NET site on Windows hosting with Plesk
Put an ASP.NET or ASP.NET Core site live on HyperDC Windows hosting: publish it, upload the files to Plesk, create an MSSQL database, connect it and add HTTPS.
- Intermediate
- 25 min read
- Updated
On this page
HyperDC Windows hosting runs your site on Microsoft IIS with ASP.NET support, Microsoft SQL Server and MySQL databases, managed in Plesk. This guide takes an application from your computer to a live, secured site.
Before you start
- Your Windows hosting service is active; open Plesk from Services › My Services, the hosting service, then the sign-in button; see log in to your control panel.
- Your domain points to the hosting account; see point a domain to your server.
- The application builds and runs on your own computer.
- If it needs a specific .NET or ASP.NET Core version, you have confirmed it with us in a ticket.
Step 1: Publish the application
ASP.NET Core
Publish to a folder outside the project folder, so that later publishes do not nest:
dotnet publish -c Release -o ..\publishThe output contains your application's .dll files and a web.config that tells IIS to start the app.
ASP.NET (.NET Framework)
In Visual Studio, choose Publish, pick a Folder target and publish. Upload the content of that folder; it includes web.config, bin and your pages.
Verify: the output folder contains web.config.
Step 2: Upload the files
- In Plesk, open Websites & Domains and the domain's File Manager, or connect with FTP; see upload website files.
- Open the document root,
httpdocsby default. - Upload the content of the publish folder (not the folder itself), replacing the default page.
Web Deploy is enabled by default on our Windows hosting. Instead of uploading files, you can publish from Visual Studio: in Plesk, download Web Deploy Publishing Settings for the domain and import that file in Visual Studio's publish dialog. Visual Studio takes over every setting except the password, which you enter yourself.
Your Plesk account also includes further advanced web tools for your sites; you find them with the domain under Websites & Domains.
Step 3: Create the database
- In Plesk, open Databases and click Add Database.
- Choose the Microsoft SQL Server database server (or MySQL), enter a database name and create a database user with a strong password.
- Open Connection Info under the database name. It shows the host name to use; for SQL Server this can include an instance name, such as
server\INSTANCE.
Step 4: Connect the application
Put the details from Connection Info into your connection string, in appsettings.json (ASP.NET Core) or web.config (ASP.NET):
{
"ConnectionStrings": {
"DefaultConnection": "Server=HOST_FROM_PLESK;Database=example_db;User Id=example_user;Password=YOUR_PASSWORD;"
}
}Step 5: Open the site and turn on HTTPS
- Open
http://example.com. The first request can take a few seconds while the application starts. - Secure the domain with the free certificate and redirect HTTP to HTTPS; see turn on free SSL and force HTTPS.
Verify: https://example.com loads your application with a padlock.
Step 6: Adjust the ASP.NET settings (ASP.NET)
For .NET Framework sites, Plesk's ASP.NET Settings for the domain let you set custom error pages, the session timeout, and compilation and globalization options without editing web.config by hand.
Troubleshooting
You see the Plesk default page or a directory error. The files are not in httpdocs, or you uploaded the publish folder itself instead of its content.
An HTTP 500.xx error appears. The number after the dot names the cause; see ASP.NET and IIS errors.
Files cannot be overwritten because they are in use (ASP.NET Core). A running app locks its files. Upload an empty file named app_offline.htm to httpdocs first: the ASP.NET Core Module stops the app and shows that page. Upload the new files, then delete app_offline.htm to start the app again.
Next steps
- Errors after deploying: ASP.NET and IIS errors.
- Keep a copy before each release: back up and restore your hosting account.
Frequently asked questions
Which .NET versions can I use?
ASP.NET is supported on every plan. If your application needs a specific .NET or ASP.NET Core version, ask us in a ticket before you deploy and we confirm whether the server offers it.
Can I publish straight from Visual Studio?
Yes. Web Deploy is enabled by default on our Windows hosting. Download Web Deploy Publishing Settings for your site in Plesk and import the file into the Visual Studio publish dialog.
Where do the files go?
Into the site's document root, httpdocs by default. The web.config file must sit in that folder, next to your application's files.
Can I use MySQL instead of SQL Server?
Yes. Every Windows hosting plan includes MySQL databases as well; create one in Plesk and use a MySQL connector for .NET in your application.