How to deploy an ASP.NET web site
I have an ASP.Net website that I built in a computer science class. I built it in Visual Studio a开发者_高级运维nd the solution is on my local drive. How would I deploy this to a real website?
You will need to do a few things.
- You will need to get a hosting account that supports ASP.NET
- From there you can use the "Publish" option from within Visual Studio under the "Build" menu option to push out a copy of the site.
When publishing you should publish in release mode.
Get hosting that supports the version of .NET and ASP.NET you have used and copy the files over.
Assuming that already you have an IIS application and web folder set up on a web server somewhere, the simplest method goes like this:
- In Visual Studio, right-click on the web application project, and click
Publish
. - Select
File System
as the publish method. - Select a target location. This is where the publishable files will be placed. Use
c:\pub
or something similar. - Hit
Publish
- Once the publish operation is done, copy everything in
c:\pub
(or whatever target folder you used in step 3) to your web folder on the web server. Depending on your server accessibility, you may need to do this via FTP.
You might also investigate ClickOnce Deployment if your server supports it.
If you don't already have server space, you'll need to find a good hosting provider that supports ASP.NET. Google has many suggestions.
精彩评论