|
| Assigning Application Pools to Virtual Directory |
 |
Thu, 28 Feb 2008 17:47:54 +000 |
I'm trying to assign an IIS application pool to Web Application virtual
directory. I have the code contained in a class Installer.cs. And I know it
works because I've done this before with VS 2003 and numerous other web setup
projects.
When the web setup program runs, the "Installation Address" screen
apears, with two textboxes.
One of the textboxes specifiies the 'Site" (where the new web virtual
directory will be located under ie.."Default Web Site")
The second textbox specifies the new web sites "Virtual Directory
Name".
And then there's a dropdown list containing all the current Application Pool
Names. By default "DefaultAppPool" is selected.
I really don't care what the dropdown has selected because my code behind is
going to change that. So I thought. Now I know the code is working and the Web
Sites Application Pool is being assigned to the value I want by vritue of the
fact I've stepped through the code in Debug mode when it's changing the value
and looking at IIS Manager. But when the setup program finishes, the Web Site
Application Pool value has changed back to what was specified in that dropdown
list I mentioned above. So in affect and reality, the setup program is blowing
off my code and reverting to what was selected in the dropdown list.
This is the code I'm using to change the value of the Web Sites Application Pool
DirectoryEntry vDir = newDirectoryEntry(metabasePath);
string className = vDir.SchemaClassName.ToString();
if (className.EndsWith("VirtualDir"))
{
object[] param = { 0, appPoolName, true };
vDir.Invoke("AppCreate3", param);
vDir.Properties["AppIsolated"][0] = "2";
vDir.Properties["AppFriendlyName"][0] = appPoolName;
vDir.Properties["AppPoolId"][0] = appPoolName;
vDir.CommitChanges();
}
Any thoughts would be appreciated
|
| Post Reply
|
| Re: Assigning Application Pools to Virtual Directory |
 |
Fri, 29 Feb 2008 13:24:12 +000 |
See www.iis.net for help configuring IIS. Same login/password as here.
Jeff
|
| Post Reply
|
|
|
|
|
|
|
|
|
|