Reputation: 1620
I've recently bought a VPS in which I wanna host a website. When I waana upload an ASP.Net MVC website in a normal shared hosting, I simply use the the publish option in the visual studio and the website gets automatically uploaded in the host. In the VPS which has Windows server 2012, there is a server manager which I used to create an area in the hard drive where I have to put my web file. (I put a hello world html file and it works)
My question is that, I have never manually uploaded an ASP.Net application before and I do know how exactly Visual Studio publish those ASP.Net website, so how can I manually build the website and put it in the VPS. I used the batch build, VS made some Dlls and I don't know what to do with them .
Upvotes: 0
Views: 1616
Reputation: 1314
If you call MS build from the command line in the following manner for instance:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe TestApp.csproj /p:Configuration=Release /t:Package
by specifying the target "Package" (/t:Package) you are commanding MSBUILD to package the website.
It will proceed to build and package your website into an MSDEPLOY package (specific zip file layout).
The build output from the sample build is actually very helpful and gives you clues as to where to go next, for example it tells us where it created the file:
Package "TestApp.zip" is successfully created as single file at the following location: file:///C:/TestApp/obj/Release/Package
It also gives us a link to find out more:
To get the instructions on how to deploy the web package please visit the following link: http://go.microsoft.com/fwlink/?LinkId=124618
Then it shows you where it created a sample .cmd file for deploying the package
Sample script for deploying this package is generated at the following location: C:\TestApp\obj\Release\Package\TestApp.deploy.cmd For this sample script, you can change the deploy parameters by changing the following file: C:\TestApp\obj\Release\Package\TestApp.SetParameters.xml
Now you can customize the ".deploy.cmd" file to publish your application on your server. Edit the ".SetParameters.xml" file to setup specific parameters for your server. Login into your server, run the command file from a console that has right to publish and all should be good.
Upvotes: 1