0

This is my current MVC Project setup for a project named ABC.sln

  • Project ABC.sln with following projects A.csproj, B.csproj, C.csproj

I am trying to publish A.csproj to IIS via VSTS Visual studio build (version 2019)

Here is my msbuild arguments:

/p:SolutionDir="$(Build.SourcesDirectory)" /p:DeployOnBuild=True /p:Configuration=$(BuildConfiguration) /p:MSDeployPublishMethod=WMSVC /p:MSDeployServiceUrl=serverpath.com /p:DeployIISAppPath=mysite.com /p:OutputPath=$(Build.BinariesDirectory) /p:AllowUntrustedCertificate=true /p:UserName= /p:AuthType=NTLM /p:DeleteExistingFiles=True /p:SkipExtraFilesOnServer=False

Solution:

$(Build.SourcesDirectory)/A/A.csproj

Platform: AnyCPU

Build runs successfully, and I do get the:

Successfully executed Web deployment task.
  Package "A.zip" is successfully created as single file at the following location:
  file:///C:/agent/_work/54/b/_PublishedWebsites/A_Package
  To get the instructions on how to deploy the web package please visit the following link:
  https://go.microsoft.com/fwlink/?LinkId=124618
GenerateSampleDeployScript:
  Sample script for deploying this package is generated at the following location:
  C:\agent\_work\54\b\_PublishedWebsites\A.deploy.cmd
  For this sample script, you can change the deploy parameters by changing the following file: 
  C:\agent\_work\54\b\_PublishedWebsites\A.SetParameters.xml
PipelineDeployPhase:
  Publish Pipeline Deploy Phase
Done Building Project "C:\agent\_work\54\s\A.csproj" (default targets).

However, I do not see where it was published. I do not see any of the files published in any folder on my IIS server for this app pool.

Why does it say package? Shouldn't the files from A.csproj be directly published to the mentioned p:DeployIISAppPath?

1 Answers1

0

Why does it say package? Shouldn't the files from A.csproj be directly published to the mentioned p:DeployIISAppPath?

One of the workaround you can follow,

  • To check if the .csproj file exist or not please check the scm site whether its available or not under D:/home/site/wwwroot . And make sure that deployed file structure is same as on Azure and IIS. Please find the reference image to check the scm site.

enter image description here enter image description here

For complete setup to deploy ASP.Net MVC app to IIS on Windows please refer this BLOG by@Asma Khalid .

For more information please refer the below links for the similar issues:-

Automatically publish web application on build from Visual Studio ,

How to deploy an ASP.NET MVC application on build using MSBuild in Visual Studio .

AjayKumarGhose
  • 4,257
  • 2
  • 4
  • 15