May 12, 2021 ASP.NET
1. ASP.NET Web Pages - Publishing Site
2. Publish your application without using WebMatrix
Learn how to publish a Web Pages application without using WebMatrix.
By using publish commands in WebMatrix (or Visual Studio), you can publish a ASP.NET Web Pages application to a remote server.
This feature copies all your application files, cshtml pages, images, and all required DLL files for Web Pages, Razor, Helpers, SQL Server Compact (if you use a database).
Sometimes you don't want to publish your application using WebMatrix. Maybe it's because your hosting service provider only supports FTP, maybe you already have a classic ASP-based website, maybe you want to copy all the files yourself, maybe you want to use other publishing software like Front Page, Expression Web, and so on.
Are you going to have a problem? Y es, it will. But you have a way to fix it.
To perform site replication, you must know how to reference the correct files, which DLL files need to be copied, and where to store them.
Follow these steps:
Before you proceed, make sure that your host is running the latest version of the ASP. NET (4.0 or 4.5).
Copy your website (all folders and content) from your development computer to the application folder on the remote host (server).
If your application contains data, do not copy the data (see point 4 below). |
Make sure that the bin folder on your remote host contains the same dll files as on your development computer.
After copying the bin folder, it should contain the following files:
Microsoft.Web.Infrastructure.dll
NuGet.Core.dll
System.Web.Helpers.dll
System.Web.Razor.dll
System.Web.WebPages.Administration.dll
System.Web.WebPages.Deployment.dll
System.Web.WebPages.dll
System.Web.WebPages.Razor.dll
WebMatrix.Data.dll
WebMatrix.WebData
If your application contains data or a database. For example, the SQL Server Compact database App_Data file in the .sdf folder, consider the following:
Do you want to publish your test data to a remote server?
Most of the time it's generally not desirable.
If you have test data on your development computer, it overrides production data on your remote host.
If you must copy the SQL Database (.sdf file), you should delete all data from the database and then copy an empty .sdf file from your development computer to the server.
That's it. GOOD LUCKļ¼
This is where you publish the entire contents of your Web Pages application without using WebMatrix.