Ben
Ben

Reputation: 282

How to specify default Application Pool in ASP.NET MVC Project?

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?

Upvotes: 3

Views: 1641

Answers (1)

Richard Szalay
Richard Szalay

Reputation: 84784

Change your parameterEntry's scope to "application":

<parameterEntry kind="DeploymentObjectAttribute" 
                scope="application" 
                 match="application/@applicationPool"/> 

Upvotes: 3

Related Questions