ASP. NET Web Pages-published websites, asp. netpages
Learn how to publish a Web Pages application without using WebMatrix.
Publish your application without using WebMatrix
You can use the Publish command in WebMatrix (Visual Web Developer or Visual Studio) to Publish the ASP. NET Web Pages application to a remote server.
This function copies all application files, cshtml Pages, images, and all required DLL files for Web Pages, Razor, Helpers, and SQL Server Compact (if a database is used ).
Sometimes we do not want to use these options. Maybe your host provider only supports FTP? Maybe your website is based on ASP? Maybe you want to copy these files yourself? Maybe you want to use other release software?
Do you have any problems? Yes, yes. But we can solve it.
To copy a site, you need to know how to reference the correct files, what DLL files are copied, and where they are stored.
The procedure is as follows:
1. Use the latest version of ASP. NET
Before you proceed, make sure that your host runs the latest ASP. NET version (4.0 or 4.5 ).
2. Copy a Web Folder
Copy the website (all folders and content) from the development machine to the application folder on the remote host (server.
If your application contains data,Do not copy the data(See step 4 below ).
3. DLL file
Make sure that the bin folder on the remote host contains the same dll file as that on the development machine.
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
4. Copy Data
If your application contains data or databases. For example, in the SQL Server Compact database (the. sdf file in the App_Data folder), consider the following:
Do you want to publish the test data to a remote server?
Generally, this is not required.
If your development machine has test data, it may overwrite the data on the remote host.
If you have to copy the SQL database (. sdf file), you may delete all the data in the database and copy the empty. sdf file to the server from the development computer.
That's all. Good luck!