0
votes

Our goal is to set up this:

.NET CORE MVC project commit -> vsts build chain -> vsts release running on on-premise-agent on our web server, running msdeploy to deploy to the server

So far we're trying to get everything working manually, i.e. with command line, with the intention of putting all this logic into VSTS later.

I've created a web deploy package in Visual Studio, including a minimal parameter file, including only the web site name.

I'm running this in command line: msdeploy.exe -source:package='packwebx/webx.zip' -dest:auto -verb:sync -setParamFile:"packwebx/param.xml"

With the result: Total changes: 0 (0 added, 0 deleted, 0 updated, 0 parameters changed, 0 bytes copied)

The target directory is empty, and the zip file is not, so I don't get why it doesn't detect changes.

I also tried running the same command but on a package from our old (.net 4.6) mvc project, which works without problems.

One difference between these project seems to be that when I'm publishing a web deploy package from our old project, more files (...deploy.cmd, ...deploy-readme.txt, sourcemanifest etc) is created, it also includes the parameters.xml file in the set of files as well as in the zip file. When I'm publishing a web deploy package from the .net core project, I only get a zip file.

Any help is appreciated, msdeploy help or advice on a better way of publishing to our iis server.

1
Do you solve this issue with my solution? - starian chen-MSFT

1 Answers

0
votes

You can deploy your web app through WinRM IIS Web Deploy step.(install IIS Web App Deployment Using WinRM extension)

Simple steps to deploy web app to IIS server:

  1. Add Command Line build step (Tool: C:\Program Files\dotnet\dotnet.exe, Arguments: restore, Working Directory: $(Build.SourcesDirectory)/src/NetCoreDemo2 (project.json path))
  2. Add Command Line build step (Tool: C:\Program Files\dotnet\dotnet.exe, Arguments: build, Working Directory: $(Build.SourcesDirectory)/src/NetCoreDemo2 (project.json path))
  3. Add Command Line build step (Tool: C:\Program Files\dotnet\dotnet.exe, Arguments: publish --configuration $(BuildConfiguration)), Working Directory: $(Build.SourcesDirectory)/src/NetCoreDemo2 (project.json path))
  4. Add Archive Files build step to create zip file
  5. Add WinRM-IIS Web App Deployment step to deploy package to IIS server.

You can refer to this article to get more information: Build and deploy your ASP.NET Core app to Azure