Click here to Skip to main content
15,883,623 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Publish asp.net website by using command prompt (cmd)
Posted

Hi Pradeep,

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

XML
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>
 
Share this answer
 
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
:-)

That's all.

—SA
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900