3

What does the DeployIisAppPath MSBuild property do?

The reason I'm asking is that I'm working with a build definition in Azure DevOps which uses it. It's a yaml definition which builds an ASP.NET Core project, and it contains the following task:

- task: VSBuild@1
  displayName: Run MSBuild
  inputs:
    solution: '$(solution)'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\ProjectName-dev.zip" /p:DeployIisAppPath="ProjectName Dev" /p:EnvironmentName=QA'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

I've cloned this existing pipeline to create a separate build, but I don't know what /p:DeployIisAppPath="ProjectName Dev" does so I don't know if/how I should change it. I can't see anything in IIS which matches ProjectName Dev (it's not the website name or anything like that) so I'm wondering if it's unused in my scenario. Is the DeployIisAppPath property intended for use in a specific situation?

For clarity, I'm not looking for a solution to a specific problem, I'm looking for an explanation of the property so I can understand what the existing pipeline is doing. I have read every stack overflow question which includes the word DeployIisAppPath, read the microsoft documentation for both this property and properties in general, and read several blog posts. Most stuff I've seen mentions the property in examples, but gives zero explanation of what it does. The nearest I've seen to an explanation is examples where the value is set to the name of the website in IIS, but this is not the case for the existing pipeline I'm using, which is working fine.

What does MSBuild do with the DeployIisAppPath property?

Tim
  • 5,435
  • 7
  • 42
  • 62
  • What research have you done? – Daniel Mann Jul 17 '20 at 17:16
  • Read every stack overflow question which includes the word `DeployIisAppPath`, read the microsoft documentation, and read several blog posts. If you have other research in mind that would be helpful for me, feel free to suggest it. – Tim Jul 17 '20 at 17:32
  • Not sure why this has a close vote, possibly someone has misunderstood my question, but to be clear I'm not looking for a recommendation. I'm looking for an explanation of some functionality in a popular piece of software. I am not seeking an opinion based answer, I want a factual explanation about what MSBuild uses the property for. If it's only used under certain conditions, I'd also like to know what those conditions are. – Tim Jul 17 '20 at 17:34
  • Any update for this issue? Have you resolved this issue? If not, would you please let me know the latest information about this issue? – Leo Liu Jul 23 '20 at 01:43
  • I didn't have an issue I was trying to resolve, I was simply trying to find an explanation of how the property is used. I'm getting a sense that it's only relevant to web deploy, though I've not seen that stated anywhere. Put bluntly, I've come to the conclusion that it's not worth trying to understand unless it causes me any problems, which it's not doing. As far as I can tell, the value is being completely ignored in my pipeline. – Tim Jul 23 '20 at 09:13

2 Answers2

1

What is DeployIisAppPath MSBuild property for?

What you found is correct.

The nearest I've seen to an explanation is examples where the value is set to the name of the website in IIS

In a special situation, if we deploy multiple webapp projects the same IIS, we need to provide the DeployIisAppPath property to specify the name of the website and the webapp name in IIS, like:

/p:DeployIisAppPath="MySite/one"

/p:DeployIisAppPath="MySite/two"

You could check this thread and this thread for some more details.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • 1
    Does `/p:DeployIisAppPath` on its own have any meaning, or must it always be followed by an underscore and some further text? Is this specific to a certain deployment method? e.g. is this used if creating a publish profile in Visual Studio for web deploy, but ignored if building & deploying through Azure DevOps pipelines, or something like that? – Tim Jul 23 '20 at 09:11
  • @Tim, Thanks your reply. It is my fault. We do not need to use it always be followed by an underscore and some further text. If we have multiple webapp projects the same IIS, we need to provide the `DeployIisAppPath` property to specify the name of the website and the webapp name in IIS when we deploy one of webapp projects, otherwise, VS/MSBuild do not know to deploy this webapp projects to corresponding projects in the IIS. Have a nice day. – Leo Liu Jul 23 '20 at 09:18
  • @Tim, How about this problem? Did the comments help you? – Leo Liu Jul 24 '20 at 07:59
  • 1
    Yeah that clarified the underscore, thanks. Is the property only used by web deploy, and ignored for other build & deployment processes? It sounds from what you're saying that it defines the name of the website in IIS, but that's definitely not happening in my use case (but I'm not using web deploy). – Tim Jul 24 '20 at 08:55
1

Summarising the thread with Leo, it seems that the DeployIisAppPath property is used by web deploy to specify the name of the website in IIS. It is ignored when not using web deploy.

Tim
  • 5,435
  • 7
  • 42
  • 62