• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 600
  • Last Modified:

Looking for the meaning of DirectoryEntry.Properties["Syntax"].ToUpper() == "BOOLEAN"

Hi,

I'm currently maintaining and reviewing some old code found in a legacy application. At some point, this app is talking to the Active Directory to create a new virtual Directory.

However, before doing so, it ensures that a property "Syntax" is different from "BOOLEAN":

System.DirectoryServices.DirectoryEntry schemaIIS;
schemaIIS = new System.DirectoryServices.DirectoryEntry("IIS://someServer/Schema/AppIsolated");

if (schemaIIS.Properties["Syntax"].ToUpper() == "BOOLEAN") {
    throw new Exception("cannot create app on server.");
}

Open in new window


I've been looking all over the Web to find the meaning of this one. I have found a lot of examples verifying this condition in a similar way...  Yet, I haven't found any explanation about what it actually does / what it means.  It must have something to do with the "AppIsolated" schema but I can't see what it is.

Any help would be appreciated!

Thanks,

Mat
0
l-ipse
Asked:
l-ipse
2 Solutions
 
Luis PérezSoftware Architect in .NetCommented:
Read the text about the AppIsolated property here:
http://flylib.com/books/en/2.21.1.194/1/

So in your code, the programmer is checking that IIS version is upper to 4.0. If 4.0 or lower, the AppIsolated property is a boolean value; if 5.0 or upper, it's a numeric value.

Hope that helps.
0
 
Julian HansenCommented:
Can't say for sure but I am guessing that it is checking to see if the Syntax of the AppIsolated property is BOOLEAN and if it is preventing the code from continuing.

Looking here http://msdn.microsoft.com/en-us/library/ms525400%28v=vs.90%29.aspx

AppIsolated appears to allow 0,1 or 2 as values - which is clearly not boolean - so if Syntax is boolean then it does not support the above options and based on that the code is deciding it cannot continue.

That's how I interpret it anyway.
0
 
l-ipseAuthor Commented:
Thank you very much guys!  That makes sense.  If IIS version is 4.0 or lower, the process cannot continue because the application doesn't support it: later in the same code, the AppIsolated property is set to 2 so the new webapp is pool-processed...
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now