如何使用命令提示符发布asp.net网站? [英] How to publish asp.net website using command prompt?

查看:132
本文介绍了如何使用命令提示符发布asp.net网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用命令提示符发布asp.net网站(cmd)

Publish asp.net website by using command prompt (cmd)

推荐答案

Hi Pradeep,



使用FTP上传文件会更容易。以下是使用FTP发布Web应用程序的步骤:



Hi Pradeep,

It will be easier to use FTP to upload your files. Here are steps to publish your web application using FTP:

1. Open your project via Visual Studio tool

2. On the Solution Explorer window, right click your project and select "Publish Website"

3. Please publish your website to your local folder, such as C:\Project

4. You will see all the files and subfolders on C:\Project, however, you will not see any code-behind files

5. Please upload whatever you see on C:\Project to the server via FTP

Please note that if your website does not even work on your local PC, it will never ever work on the server. This is why it is important to ensure that your site works on your local PC first

Also, please kindly add a customError tag on your web.config so that you can view the error message directly (if in case there is an error). This can be something like:

<customerrors mode="RemoteOnly" defaultredirect="GenericErrorPage.htm">
<error statuscode="403" redirect="NoAccess.htm" />
<error statuscode="404" redirect="FileNotFound.htm" />
</customerrors>


这个问题没什么意义,但......



例如,使用所有必需的命令编写批处理文件,以将文件从开发计算机复制到目标主机。通常这是使用FTP完成的,但这一切都取决于托管的设置方式。从来没有看到任何非废话托管包不提供FTP部署/支持。假设文件名为publish.bat。



对于此批处理的命令行启动,请键入:

This question makes very little sense, but…

For example, write the batch file with all required commands to copy files from your development computer to the target host. Usually this is done using FTP, but it all depends on how the hosting is set up. In never saw any non-nonsense hosting packages not providing FTP for deployment/support. Let's say, the file name is "publish.bat".

For command-line start of this batch, type:
publish

:-)



这就是全部。



-SA


这篇关于如何使用命令提示符发布asp.net网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆