IIS 5.0 Metabase/DirectoryServices

G

Guest

Hi

I'm creating a virtual directoy using .net's
DirectoryServices framework component. We're using IIS 5.0

The properties I'm setting are

vDir = iisAdmin.Children.Add(virtualDirectory.Name, "IIsWebVirtualDir")
vDir.Properties["AppFriendlyName"][0]= virtualDirectory.AppFriendlyName
vDir.Properties["AppIsolated"][0] = virtualDirectory.AppIsolated
vDir.Properties["AccessRead"][0] = virtualDirectory.AccessRead
vDir.Properties["AccessWrite"][0]= virtualDirectory.AccessWrite
vDir.Properties["AccessExecute"][0]=virtualDirectory.AccessExecute
vDir.Properties["AccessScript"][0]=virtualDirectory.AccessScript
vDir.Properties["AccessSource"][0]= virtualDirectory.AccessSource;
vDir.Properties["AccessNoRemoteRead"][0]= virtualDirectory.AccessNoRemoteRead;
vDir.Properties["AccessNoRemoteWrite"][0]= virtualDirectory.AccessNoRemoteWrite;
vDir.Properties["AccessNoRemoteExecute"][0]=virtualDirectory.AccessNoRemoteExecute
vDir.Properties["AccessNoRemoteScript"][0]=virtualDirectory.AccessNoRemoteScript;
vDir.Properties["EnableDefaultDoc"][0]=virtualDirectory.EnableDefaultDoc
vDir.Properties["EnableDirBrowsing"][0]=virtualDirectory.EnableDirectoryBrowsing
vDir.Properties["AccessFlags"][0]=virtualDirectory.ExecutionPermission
vDir.Properties["DefaultDoc"][0]= virtualDirectory.DefaultDoc;
vDir.Properties["Path"][0]=virtualDirectory.Path
vDir.CommitChanges()

I can view the virtual directory in the IIS snap in, and
it looks ok. However, when I try to launch a page, I get a
erver error. (The server failed to load
application '/LM/W3SVC/1/Root/DeploymentTest'. The error
was '8007053d'.

Any ideas

Thanks

Ke
 
W

Willy Denoyette [MVP]

This is because you didn't create a Web application definition, check the
AppCreate2 method in the Platform SDK doc's for details, but the following
should get you started:

// Call AppCreat2 to create a Web application (0 =In-proc, 1 = Out-proc, 2
= Pooled) , not needed for ASP.NET
object[] applicationType = new object[]{0};
vDir.Invoke("AppCreate2", applicationType);

Willy.
 
G

Guest

Willy

Thanks for the info. I was originally calling the AppCreate method after I had already commited the metabase entry for the virtual directory since in some cases I don't need an application. I've placed that call up into the code and call it before the info is commited to the metabase.

Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top