Question

I have been trying to get msbuild generate the correct web deploy package so that I can poke in the values for Application Pool Identity.

In my project I have the parametes.xml with the following entry for the user and password:

  <parameter name="username" description="AppPool identity username" defaultValue="domain\username">
    <parameterValidation type="RegularExpression" validationString="(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$" />
    <parameterEntry type="DeploymentObjectAttribute" scope="processModel" match="/processModel/@userName" />
  </parameter>
  <parameter name="password" description="AppPool identity password" tags="password" defaultValue="DefaultPassword">
    <parameterEntry type="DeploymentObjectAttribute" scope="processModel" match="/processModel/@password" />
  </parameter>

The msbuild command I use:

"C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe" "./TestSolution.sln" 
/p:configuration="Release" 
/p:outdir=".././deploy/Packages/Release" 
/target:clean;build
/p:DeployOnBuild=true;
    DeployTarget=Package;
    IncludeAppPool=true;
    IncludeIisSettings=true;
    DeployEncryptKey=Password

The package gets generated correctly, but the issue is with the new parameters.xml that is placed inside the zipped folder. The username/password entry has been changed to:

  <parameter name="Username" description="Identity Username" defaultValue="domain\username" />
  <parameter name="Password" description="Identity Username Password" defaultValue="DefaultPassword" tags="password" />

As you can see the parameterEntry and Validation have been removed. If I try to deploy the application using msdeploy and set the username and password in SetParameters, it does not poke the new values for the ApplicationPool.

If I manually add the removed lines back into the package, the deployment works correctly and the application pool gets the identity set in SetParameters file.

Is this by design? Is there a way to force msdeploy not to remove those lines when it builds the package?

I have spent past few days trying to get this to work, and any examples I came across have not solved this.

Hoping someone might have some insight.

Était-ce utile?

La solution

Finally found the issue!

It was with the way that the parameters were defined. If you look at the Parameters.xml I am defining everything using:

<parameterEntry type=

Changing all "type" to "kind" generates the correct package parameters.xml and enables poking of application identity.

This was because I used the code that was posted on IIS forums:

http://forums.iis.net/t/1176867.aspx

This seems to be incorrect for this application. Not sure if its a version difference or something else.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top