StuTheDog
StuTheDog

Reputation: 451

msdeploy + setParameters.xml, how to set web physical file location

This question has been danced around a bit, forgive me if it is a duplicate but I haven't been able to find an exact answer.

I am trying to create a Parameters.xml for deployment configuration that specifies the destination physical file folder for a web site. This is for an automated build using TeamCity, e.g. commandline using .deploy.cmd.

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 in how I am declaring the scope but am unsure what needs to be done.

Upvotes: 4

Views: 5693

Answers (1)

Richard Szalay
Richard Szalay

Reputation: 84724

Assuming Default Web Site/iag.application.services.exampleservice is a virtual directory in IIS (DestinationVirtualDirectory is only valid for "applications"), you can probably just get away with removing the / suffix and not encoding it. (I've 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 don't have to declare parameters before you set them. You could just as easily 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" />

Upvotes: 3

Related Questions