chester89
chester89

Reputation: 8607

MsDeploy wont package and deploy XML files for projects other then MSBuild was run on

We deploy ASP.NET Web Api to a web server using MSDeploy. It is launched from TeamCity, which has an MSBuild step that build code and deploys it.
MsBuild is run on our web API project only (lets call it WA), not on the whole solution. I don't know if it's relevant. I think it's not - see why lower.
Our API generates Swagger documentation. Problem is - Swagger can't find the XML documentation for one of the projects (lets call it B) that WA depends on.
When I build solution on my development machine - Swagger works fine without errors. Problem only appears when we deploy from TeamCity to our test environment.
I investigated and found that missing file is generated during build, but MsDeploy won't package and bring it over. That's why I think MsBuild on project vs solution is not an issue here.
First thing I did was add <DocumentationFile> node for every configuration of projects B and WA. That didn't help much.
Here are MsBuild parameters we use on TeamCity: /property:Platform=AnyCPU /property:DeployOnBuild=True /property:DeployTarget=MSDeployPublish /property:CreatePackageOnPublish=True /property:AllowUntrustedCertificate=True /property:MSDeployPublishMethod=WMSvc /property:SkipExtraFilesOnServer=False /property:DeployIisAppPath=OurApiName. They are fairly standard.
We also provide some other parameters through system properties - Configuration, UserName, Password, MsDeployServiceUrl.
I did try this solution, but the problem is still there.

Upvotes: 1

Views: 368

Answers (1)

chester89
chester89

Reputation: 8607

If anyone else hit this - I solved the problem by modifying my .csproj file according to this article.
Couldn't get it working at first, but then I tried all the path combinations I could think of and one of those worked. Be careful with leading slashes

Upvotes: 1

Related Questions