Installing and/or configuring a production-ready web server, such as Internet Information Services (IIS) or Apache, can be a very complex task depending on a number of things that we can't address now, as they would easily bring us far beyond the scope of this book.
To keep things simple, we'll just assume that we already have access to an up and running, physical or virtualized Windows Server machine featuring a running IIS instance (we'll call it web server from now on) that we can configure to suit our needs. Ideally, we'll be able to do that via a dedicated management interface such as Remote Desktop, IIS Remote Configuration, Plesk, or any other remote administration mechanism made available by our web farm and/or service provider.
Last but not least, we'll also assume that our web server provides FTP-based access to the /inetpub/
folder that we can use to publish our web projects.
The most convenient way to deploy a web-based project in Visual Studio is creating one or more Publish profiles. Each one of them is basically an XML configuration file with a .pubxml
extension that contains a set of deployment-related information, most of which depends on the server/target we're deploying our application into, Azure, FTP, filesystem and more.
We can easily set up one or more Publish profile files using the Publish profile wizard. As soon as we have at least one ready, we'll be able to execute it with a single mouse click and have our application published.
To open the Publish profile wizard, right-click on the project's root node (OpenGameListWebApp
in our case) and select the Publish... option from the contextual menu. A pop-up window should open showing the following welcome screen:
Among the various available profiles, the easiest to configure is the one that builds everything into a dedicated folder within our local File System. To create it, follow these steps:
Production-FileSystem
./bin/Release/
subfolder. However, it's strongly advisable to change it and to choose an external directory instead.We can then click on the Publish button to start the publishing process. Once done, we'll have to manually upload the generated contents to the web server.
As a viable alternative we can also create a Publish profile that will automatically upload our web project to our web server using a properly configured FTP connection endpoint: we will then link the remote destination folder to a new website project using IIS.
We already know how to launch the wizard. Right-click on the project's root node and select Publish. Wait for it to start, then do the following:
Production-FTP
.ftp.your-ftp-server.com
. In the Site Path option, insert the target folder from the FTP server root, such as /OpenGameList/
.Right after that, the wizard's Connection tab should eventually look not too different from the following screenshot: