Msdeploy + setParameters.xml how to set the location of a web physical file

This question was dancing a bit, forgive me if this is a duplicate, but I could not find the exact answer.

I am trying to create a Parameters.xml deployment configuration that specifies the folder of the physical destination file for the website. This is for automatic build using TeamCity, for example. using the .deploy.cmd command.

Can someone explain what I need to do?

Parameters.xml:

<parameter name="physicalPathLocation" description="Physical path where files for this Web service will be deployed." defaultValue="\" tags="PhysicalPath"> <parameterEntry kind="DestinationVirtualDirectory" scope="Default\ Web\ Site/iag\.application\.services\.exampleservice/" match="" /> </parameter> 

And in SetParameters.xml

 <setParameter name="physicalPathLocation" value="C:\MyFolder\MySite" /> 

I suspect my problem is how I declare the scope, but not sure what needs to be done.

+4
source share
1 answer

Assuming that Default Web Site/iag.application.services.exampleservice is a virtual directory in IIS ( DestinationVirtualDirectory is only applicable to "applications"), you might just get rid of removing the suffix / rather than encoding it. (I also removed the match attribute)

 <parameter name="physicalPathLocation" description="Physical path where files for this Web service will be deployed." defaultValue="\" tags="PhysicalPath" > <parameterEntry kind="DestinationVirtualDirectory" scope="Default Web Site/iag.application.services.exampleservice" /> </parameter> 

Keep in mind that you do not need to declare parameters before configuring them. You could simply declare the full parameter and set it at the same time:

 <setParameter name="physicalPathLocation" kind="DestinationVirtualDirectory" scope="Default Web Site/iag.application.services.exampleservice" value="C:\MyFolder\MySite" /> 
+3
source

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


All Articles