Easy Tutorial
❮ Prop Webcontrol Listitem Enabled Aspnet Forms ❯

ASP.NET Web Pages - Publishing Websites

Learn how to publish Web Pages applications without using WebMatrix.


Publishing Your Application Without WebMatrix

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

This feature copies all your application files, cshtml pages, images, and all necessary DLL files for Web Pages, Razor, Helpers, and SQL Server Compact (if using a database).

Sometimes you may not want to use WebMatrix to publish your application. Perhaps because your hosting provider supports only FTP, or you already have a classic ASP-based website, or you want to copy all the files yourself, or you want to use other publishing software like FrontPage, Expression Web, etc.

Will you encounter issues? Yes, you will. But you have ways to resolve them.

To perform the website copy, you must know how to reference the correct files, which DLL files need to be copied, and where to store them.

Follow these steps:


1.

Use the latest version of ASP.NET

Before proceeding, ensure that your host is running the latest version of ASP.NET (4.0 or 4.5).


2.

Copy the Web Folder

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

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


3.

Copy DLL Files

Ensure that your remote host's bin folder contains the same DLL files as on your development computer.

After copying the bin folder, it should include the following files:

Microsoft.Web.Infrastructure.dll


4. Copy Your Data

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

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

Most of the time, you usually do not.

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

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

That's it. GOOD LUCK!

❮ Prop Webcontrol Listitem Enabled Aspnet Forms ❯