Learning How to Preview Website Pages without Using WebMatrix

Publishing your applications without using WebMatrix, you can deploy a SP.NET WebPages application on a remote server simply by using the publish command in WebMatrix (or Visual Studio). This feature replicates all files of your application, including .cshtml pages, images, and all necessary DLLs for WebPages, Razor, Helpers, and SQL Server Compact (if a database is used).

Sometimes you may not want to use WebMatrix to deploy your applications.
This could be due to your hosting service provider only supporting FTP, or perhaps you already have a site based on classic SP, or maybe you want to manually copy all files, use other publishing software like FrontPage, ExpressionWeb, and the like.

Are you going to encounter any problems?
Yes, there are.
But you do have solutions.
To carry out website copying, 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. Ensure you're using the latest version of SP.NET.
Before proceeding further, make sure that your host is running the latest version of SP.NET (version 4 or higher).

2. Copy the web folder.
Copy all folders and content of your website from your development computer to the application folder on the remote server.

3. Do not copy data if your application contains data or databases.
If you're using a SQL Server Compact database, for example, an .sdf file in the pp_Data folder, here are some considerations:
Do you want to publish your test data on the remote server?
Most of the time, it is generally not recommended as any test data on your development machine will overwrite production data on the remote host.
If you must copy a SQL database (.sdf file), you should erase all the data from the database and then copy an empty .sdf file to the server.

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

5. After copying bin folder.
The bin folder should contain files such as:
* Microsoft.Web.Infrastructure.dll
* NGet.Core.dll
* System.Web.Helpers.dll
* System.Web.Razor.dll
* System.Web.WebPages.Administration.dll
* System.Web.WebPages.Deployment.dll
* System.Web.WebPages.dll
* WebMatrix.Data.dll

6. Copy your data.
If your application contains data or a database, for example, SQL Server Compact database (.sdf file), consider the following points:

And that's it!
GOOD LUCK with your website page previewing!