3

In my ASP.NET MVC project I have added a parameters.xml file that looks like:

<?xml version="1.0" encoding="utf-8" ?>
<parameters>
  <parameter name="Application Pool" description="Application Pool Name" defaultValue="PreferredPool">
    <parameterEntry kind="DeploymentObjectAttribute"
                    scope="appHostConfig"
                    match="application/@applicationPool"/>
  </parameter>
</parameters>

Then I go ahead and build the deployment package:

MSBuild.exe myproject.csproj /t:Package /p:PackageLocation="C:\packages\myproject.zip"

And then I invoke the batch script generated (myproject.deploy.cmd) and deploy the app to a local IIS 7 server. The problem is, it is always the Default Application Pool that is assigned to the app instead of the PreferredPool as specified in parameters.xml.

What did I do wrong?

1 Answer 1

3

Change your parameterEntry's scope to "application":

<parameterEntry kind="DeploymentObjectAttribute" 
                scope="application" 
                 match="application/@applicationPool"/> 
Sign up to request clarification or add additional context in comments.

5 Comments

I have seen this answer elsewhere, but doesn't seem to work for me... How does this get used by MSDeploy anyhow?
@EdmundYeung99 - It can only change the property if it's there to begin with. Open the package (sync to one if you're working with a non-package source) and have a look at the archive.xml. If you don't see an <application /> element with an applicationPool attribute, then the parameter won't do anything as there's nothing to change.
ok, that's my problem. How can I get an <application /> section generated in my archive.xml? I'm using msbuild to create my package
@EdmundYeung99 - Ask as a separate question (tag it as msdeploy), and I'll take a look. These comments aren't intended to be discussion forums :)
sorry you are right, I've created a new question: stackoverflow.com/questions/13594670/…. Thanks for your help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.