Learning how to deploy WebPage applications without using WebMatrix is a skill every advanced website developer should master. By deploying your application without relying on WebMatrix, you can harness more flexibility and control over the deployment process.

Deploying your web application via the ‘Publish’ command in WebMatrix or Visual Studio allows you to publish a .NET WebPage application to a remote server. This feature takes care of copying all your application files, CSHTML pages, images, as well as all necessary DLL files for WebPages, Razor, Helpers, and SQL Server Compact (if you’re using a database). However, there may be times when you prefer not to use WebMatrix for publishing.

This could be due to various reasons. Perhaps your hosting service provider only supports FTP, or you might already have an existing classic SharePoint site you want to update with your new application. Maybe you simply want to manually copy all the files, or you might opt to use other publishing software like FrontPage or Expression Web.

Will you encounter any issues? Indeed, there is a possibility of encountering problems. But fear not, as there are solutions available.

To execute the website replication process, you need to know how to reference the correct files, identify which DLL files need to be copied, and determine where they should be stored. Follow these steps:

  1. Ensure that your host runs the latest version of .NET before proceeding.

  2. Copy the Web folder: From your development computer, copy all the website files (including all folders and content) into the application folder on the remote server.

    • If your application includes data, ensure not to copy that data at this stage.
  3. Copy DLL files: Make sure the bin folder of your remote host contains the same .dll files as those present on your development computer. After copying the bin folder, it should include the following files:

    • Microsoft.Web.Infrastructure.dll
    • NGet.Core.dll
    • System.Web.Helpers.dll
    • System.Web.Razor.dll
    • System.Web.WebPages.dll
    • System.Web.WebPages Administration.dll
    • System.Web.WebPages.Deployment.dll
    • System.Web.WebPages.dll
    • WebMatrix.Data.dll
    • WebMatrix.WebData4.dll
  4. Copy your data: If your application contains data or a database (like an SQL Server Compact database with a .sdf file stored in the pp_Data folder), consider the following:

    • Do you want to publish your test data to the remote server? Most of the time, it’s best not to.

    • If there is any test data on your development computer, publishing it may overwrite the production data on your remote host.

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

And that’s it! Good luck with your advanced website development!