How to deploy an ASP.NET Core application using WebDeploy using TeamCity?

I'm having trouble understanding how to publish the main ASP.NET application on the server using Webdeploy on TeamCity.

I installed the teamcity plugin for the dotnet kernel and completed two build steps:

  • dotnet recovery (as a command line step, built-in nuget timeout)

  • dotnet publish src / projectName / projectName.csproj

However, I am confused as to what to do for the third step, which should publish the result of dotnet publish on our server.

Traditionally, we will use MSBuild and customize the publishing profile, however I'm not sure if the .NET kernel uses MSBuild.

I have a publication profile as part of my solution that works successfully in VS2017. I looked at the TeamCity blog, which discusses how to configure TeamCity to use .NET Core, and although it mentions WebDeploy, it just mentions that it can be used with dotnet publish without explaining how to do it.

+5
source share
1 answer

However, I am confused as to what to do for the third step, which should publish the result of publishing dotnet on our server.

Traditionally, we will use MSBuild and customize the publishing profile, however I'm not sure if the .NET kernel uses MSBuild.

I also found documentation on .NET Core auto-deployment. There are usually two options for deploying to IIS.

You can still use MSBuild with /p:DeployOnBuild=true to deploy the .pubxml publishing profile created in Visual Studio, as well as for .NET .NET sites. Run MSBuild after restoring dotnet and instead publishing to dotnet.

Or you can also use dotnet publishing to publish to a folder and msdeploy.exe to synchronize this folder with the IIS site, possibly on a remote computer. Usually:

 msdeploy.exe -verb:sync -source:contentPath="<the folder published to by dotnet publish>" -dest:contentPath=<Your IIS Site> 
0
source

Source: https://habr.com/ru/post/1267141/


All Articles