By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,719 Members | 1,036 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,719 IT Pros & Developers. It's quick & easy.

DirectoryEntries.Find Method get Exception from HRESULT: 0x80005008 or NullReferenceException

P: n/a
public DirectoryEntry Find(string, string) method get Exception from
HRESULT: 0x80005008
public DirectoryEntry Find(string); method get NullReferenceException

source code :

string strSchema = "IIsWebVirtualDir";
string strRootSubPath = "/W3SVC/1/Root";
DirectoryEntry deRoot= new DirectoryEntry("IIS://localhost" +
strRootSubPath);
try
{

DirectoryEntry deNewVDir =
deRoot.Children.Add("docula5",deRoot.SchemaClassNa me);
deNewVDir.Properties["Path"].Insert(0,"D:\\temp");
// Create a Application
deNewVDir.Properties["AccessRead"].Add(true);
deNewVDir.Properties["AccessScript"].Add(true);
deNewVDir.Properties["Path"].Add("D:\\temp");
deNewVDir.Properties["AppFriendlyName"].Add("docula5");
deNewVDir.Invoke("AppCreate",true);
// Save Changes
deNewVDir.CommitChanges();
deRoot.CommitChanges();
deNewVDir.Close();
deRoot.Close();
DirectoryEntry rootfolder = new
DirectoryEntry("IIS://localhost/W3SVC/1/ROOT");
DirectoryEntry de = rootfolder.Children.Find("docula5",
"IIsWebVirtualDir");//,rootfolder.SchemaClassName);

win2000 Pro
Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ASP.NET Gurus,

I have similar problem on Windows Server 2003, while finding an
existing website. The same find works if there is no website found,
but fails with the similar exception when finding a specific website
in the list of websites.

Your help is greatly appreciated.

Thanks
Meher/-
Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.