How to use msdeploy to deploy an existing website on remote server - msdeploy

I already created a website "MyWebsite" on IIS on Windows server 2012, the physical path is C:\builds\MyWebsite\wwwroot, there are 1 other folders approot under directory C:\builds\MyWebsite, which is also necessary to make the website run. What I want to do is:
create a new folder C:\builds\MyWebsiteNewBuild in remote server which will be used to put my new build;
dump my new build D:\Release\PublishOutput from my local machine to the remote server, the publish output has 2 sub folders: wwwroot and approot;
change the physical path of "MyWebsite" to the new created folder C:\builds\MyWebsiteNewBuild\wwwroot, and restart the service.
I am new to the msdeploy, I searched and it seems that I can use
msdeploy.exe -verb:dump-source:contentPath="D:\Release\PublishOutput" -dest:contentPath="C:\builds\MyWebsiteNewBuild",computerName="https://**.**.**.**/MsDeploy.axd",userName='administrator',password="*****",authType='Basic' -allowUntrusted
to dump my new build to remote server's destination folder, but the other requirements, such as change the physical path of my existing website, I don't know how to do.

You could change the website path using the appcmd through WebDeploy by using a manifest.
<runcommand path="%windir%\system32\inetsrv\appcmd set app /app.name:"Default Web Site/app12" /[path='/'].physicalPath:C:\temp\app12" waitInterval="5000"/>
http://www.dotnetcatch.com/2016/06/28/webdeploymsdeploy-quick-tip-change-iis-siteapp-physical-path-with-msdeploy/
The following post describes how to create a custom WebDeploy package based on a manifest:
http://www.dotnetcatch.com/2016/06/23/deploy-an-asp-net-website-not-web-application-with-msdeploy/

Related

ASP.NET MVC project to push to a remote server

I have a ASP.NET MVC project locally, but want to push to a remote server so that others can use that website. I have login access to the remote server.
Is this what i need to do?
1) add a folder to IIS in the remote server
2) copy my files to the folder on remote server. If so, which files should i copy?
If you're using Visual Studio (not code) then right click on the project and select publish, then select the options to publish to a local folder. Copy all files in your published folder to your server.
If you're using ASP.NET Core then you can also navigate to the project folder and use the following command
dotnet publish -c Release -o PUBLISH_PATH_HERE
You will need to ensure that the server has your version of .NET runtime installed.
Create a release publish profile, publish, grab the files from the directory it published to. This is the simplest way. You can automate this process if you have many releases. For example publishing directly to the server or checking code into a source control of some kind and having it publish to the server.

Deploy web application on IIS with FAKE

Im trying to deploy asp.net mvc application to IIS on a remote PC with Fake.
I can build everything successfully. I also make nuget package of my webapp as Fake.Deploy
use nuget packages for deployment. but what should I add in my fsx script in nuget to stop IIS, then move the bin and content of a new site into virtual directory and then start IIS?
I dont want to use octopus deploy, so some fake script or cmd line would be just fine.
You can write any .NET(F#) code in *.fsx file.
As far as I know you should be able to reference FakeLib.dll and use all available helper functions
#r "FakeLib.dll"
open System.Diagnostics
open Fake
// Stop IIS process
Process.Start(ProcessStartInfo("iisreset.exe", " /stop"))
// Copy missing/updated files
XCopy "your source directory path" "your destination directory path"
// Start IIS process
Process.Start(ProcessStartInfo("iisreset.exe", " /start"))

Host the published site in nopcommerce

I am working in ecommerce website using NopCommerce2.2. I hosted the website by copying the complete source code in the wwwroot of the dotnet panel. It was working fine. But the size was huge. It was around 700MB. So I published the Nop.Web and its Administration. The site was working fine in the localhost(i.e local server) using IIS7. But when I copied the contents directly to the wwwroot in the global server,it was redirecting to the error page errorpage.htm?aspxerrorpath=/ instead of the site. Can anyone suggest a solution?
Copy your website (all folders and content) from your development computer to an application folder on your remote hosting computer (server).
Make sure the bin folder, on your remote hosting computer, contains the same dll files as on your development computer.
Copy Your Data
If your application contains data or a database. For instance an SQL Server Compact database (a .sdf file in App_Data folder), consider the following:
Do you want to publish your test data to the remote server?
Most likely not.
If you have test data on your development computer, it may overwrite production data on your remote hosting computer.
If you have to copy an SQL database (.sdf file), perhaps you should delete everything in the database, and then copy the empty .sdf file from your development computer to the server.
THAT'S IT. GOOD LUCK !
You need to follow the following steps as I mentioned
For Publishing the NopCommerce Application website below is the step:
Step : 1 - Publish the Nop.Web project.
Step : 2 - Publish the Nop.Admin project.
Go to the publish folder where your publish created
Step : 3 - Cut all dll from the Administration and Paste all dll to bin folder which in main bin folder for whole project.
Step : 4 - Copy two things from your source project and in App_Data folder Settings.txt and InstalledPlugins.txt which is not published in your publish file so paste this two files in your publish folder in App_Data. (You need to change the connection string in Setting.txt as per your database host).
Step : 5 - Now you need to copy whole plugins folder from your source folder (but remember this plugins folder you need to copy from the Presentation folder not from the main source where the solution file are there.).
Step : 6 - Now your publish have been ready.(now you can deploy on hosting server)

Deploying ASP.net on IIS in windows 7

I've never actually used IIS, and I'm pretty new to the whole ASP.net thing too.
Basically, I've created a RESTful service using a VS2010 ASP.net project.
I'm not sure how you get that ASP.net application (which runs great on Visual Studio) to run on an IIS server.
It's pretty easy with a Java dynamic web project and Tomcat, but here I'm not sure how to begin.
Do I simply deploy the binaries to a directory?
Thanks!
ther are some possibilities
the easy one
create under c:\inetpub\wwwroot\ a new directory for your app
in the iis manager, configure this directory (create an application, set the right .net version, ... ). than everything you need is to copy all your files into that directory and thats it.
but you can also create a msi file, if you don't have the direct access to the server.
hth
For best testing you application use IIS 7.5 express on you development machine and set this:
project->Properties->Web->Use Local IIS Web Server
After testing under local IIS you can deploy you project to real IIS by using Build->Publish 'Your project'
Simplest way is deploying to File System in some folder and copy its content to created site folder, associated with IIS Virtual directory. To create Sites and virtual directories, see this:
http://www.bloggingdeveloper.com/post/Creating-IIS7-sites-applications-and-virtual-directories-using-Internet-Information-Services-Manager.aspx
http://mvolo.com/blogs/serverside/archive/2007/07/12/Creating-IIS7-sites_2C00_-applications_2C00_-and-virtual-directories.aspx

Execute ClickOnce application located on share, through HTTP?

i have a ClickOnce application (online only) which is deployed on a network share. People can run the application by creating a shortcut to i:\ApplicationDirectory\ApplicationName.application
where i is the letter of the drive of the networkshare.
I want to start the application over HTTP. For this, I need the .Application file to be accessible through my webserver. However I am unable to select the ApplicationDirectory as a virtual directory for IIS. I tried copying the .Application file to a virtual IIS path, but this makes the deployment corrupt (i also updated application_files reference in the .Application file). Is there a(nother) way to start a ClickOnce application, deployed on a network share, over HTTP?
First find your ClickonceKey.pfx, in other words the key used to sign assemblies.
Then find mage.exe, the utility for signing manifests that's part of the .NET Framework SDK. For VS2005, it can be found at %ProgramFiles%\Microsoft Visual Studio 8\SDK\v2.0\Bin.
Then create a batch file to execute mage.exe.
Then copy the contents of the network share deployment folder to a new virtual directory on the web server.
Finally, run the batch file.
The batch file should look something like this:
mage.exe
-update >>path to your application manifest in the virtual directory<<
-providerurl >>location of application manifest virtual directory<<
-certfile Clickoncekey.pfx -password >>your password<<

Resources