Latest web development tutorials

ASP.NET Web Pages - publishing

Learn how to publish Web Pages application without the use WebMatrix.


In the case without using WebMatrix publishing your application

By WebMatrix (or Visual Studio) in the use of an order, you can publish a ASP.NET Web Pages application to a remote server.

This function will copy all of your application files, cshtml pages, images, as well as for Web Pages, Razor, Helpers, SQL Server Compact (if using a database) all necessary DLL files.

Sometimes you do not want to use WebMatrix publishing your application. Perhaps because your hosting provider only supports FTP, maybe you already have a classic ASP-based Web site, you might want to copy all of the files yourself, you might want to use Front Page, Expression Web and some other publishing software.

You have a problem? Yes, it will. But you have a way to solve it.

To perform the site copy, you must know how to refer to the correct file, which DLL files you want to copy and store them where they are.

Follow these steps:


1. Using the latest version of ASP.NET

Before you proceed, make sure that your host is running the latest version of ASP.NET (4.0 or 4.5).


2. Copy the Web Folders

Copy your website (all the folders and content) to the application file on the remote host (server) from a folder on your development computer.

lamp

If your application contains data, do not copy the data (see point 4 below).


3. Copy the DLL files

Make sure that bin file on your remote host folder contains the same dll file on your development computer.

After copying the bin folder, which 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


4. Copy your data

If your application contains the data or database. Such as SQL Server Compact database (a .sdf file in the App_Data folder), please consider the following:

Do you want to publish your test data to a remote server?

Most of the time generally is not desirable.

If you have test data on your development computer, it will overwrite your production data on the remote host.

If you must copy the SQL database (.sdf file), then you should delete all the data in the database, then copy an empty .sdf file from your development computer to the server.

That's it. GOOD LUCK!