23

I have found out how to set the application pool and default value

<parameter name="applicationPool" defaultValue="MyDefaultValue" >
  <parameterEntry kind="DeploymentObjectAttribute" scope="application"
                  match="application/@applicationPool" />
</parameter>

Does anyone know how to set the "IIS Web Application Name"? It gets generated in the SetParameters.xml file as

<setParameter name="IIS Web Application Name" value="Default Web Site/MySite_deploy" />

I can overwrite the SetParameters.xml file, but I would rather set it up in the Parameters.xml file, but I can't find the parameterEntry type.

Thanks

4
  • I dont follow the question, can you explain what steps you are taking and what you would like to happen? Commented Jan 9, 2013 at 9:18
  • Basically I want to have a different web site than "Default Web Site", but I would prefer to specify this in the default value of the Parameters.xml file. That way I will not need to overwrite the generated SetParameters.xml file. Commented Jan 9, 2013 at 15:33
  • So you're building a package that you are later publishing with msdeploy.exe? Commented Jan 9, 2013 at 16:22
  • Correct. I currently overwrite the SetParameters.xml file before calling the msdeploy cmd file. I would like to just store the default values in parameters.xml file so that I only have one file in each of my solutions. I can set things like AppPool and physical path, but the one thing I apparently can't do is set the IIS web application. Just trying to simplify our deploy process to remove a step. Thanks. Commented Jan 9, 2013 at 20:52

1 Answer 1

37

You should be able to override the default value stored in the package by defining a DeployIisAppPath property when you generate the package

Alternatively, you can declare DisableAllVSGeneratedMSDeployParameter=true and Visual Studio will no longer automatically generate any parameters for you, you'll have to declare them all yourself.

If you're declaring the web site parameter yourself, the kind will be ProviderPath. The scope will either be iisApp or contentPath depending on what provider is being used. Tear open a package and look in the archive.xml file, the value will be an immediate child of the root manifest element.

Sign up to request clarification or add additional context in comments.

6 Comments

Thanks Richard, both approaches worked. --Project file <PropertyGroup<DisableAllVSGeneratedMSDeployParameter>true</DisableAllVSGeneratedMSDeployParameter></PropertyGroup> ` --Parameters.xml <parameter name="IIS Web Application Name" defaultValue="MySite/MyApp"> <parameterEntry kind="ProviderPath" scope="IisApp" match="@defaultValue" /> </parameter> or --project file <PropertyGroup> ` <DeployIisAppPath>MySite/MyApp</DeployIisAppPath> ` </PropertyGroup> I went with the second approach.
Where do you put <DisableAllVSGeneratedMSDeployParameter>True</DisableAllVSGeneratedMSDeployParameter>? In the Visual Studio project file?
@Heinrich Either in a PropertyGroup element or as a command line parameter /p:DisableAllVSGeneratedMSDeployParameter=true
@RichardSzalay If I use a <PropertyGroup> element, which file does it go in? I've tried this in my csproj file and it just gives a compile error about DisableAllVSGeneratedMSDeployParameter. I'm using VS2013.
@Heinrich - Your .pubxml would be your best choice, but you can also put it in your csproj. An XML file named ProjectName.wpp.xml would also be shared between all publish profiles.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.