S
sudhapadmas
Hello netters,
I was trying to create a virtual directory in IIS using the following
code:
System.EnterpriseServices.Internal.IISVirtualRoot vr = new
System.EnterpriseServices.Internal.IISVirtualRoot();
string sError;
vr.Create("IIS://localhost/W3SVC/1/Root",@"C:\Program
Files\Soft","WebServices",out sError);
Console.WriteLine(sError);
But I am getting following errors:
System.Runtime.InteropServices.COMException (0x80070003): The system
cannot find the path specified
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_IsContainer()
at System.DirectoryServices.DirectoryEntries.CheckIsContainer()
at System.DirectoryServices.DirectoryEntries.Add(String name, String
schemaClassName)
at System.EnterpriseServices.Internal.IISVirtualRoot.Create(String
RootWeb, String inPhysicalDirectory, String VirtualDirectory,
String&.....
I even tried to create virtual directory using System.DirectoryEntry.
It gives me the same error.
Iam sure C:\Program Files\Soft exists . I am doubtful if Iam making
some mistake in passing first parameter.
Can Somebody please tell me what is going wrong?
Thanking you in advance,
Sudha
I was trying to create a virtual directory in IIS using the following
code:
System.EnterpriseServices.Internal.IISVirtualRoot vr = new
System.EnterpriseServices.Internal.IISVirtualRoot();
string sError;
vr.Create("IIS://localhost/W3SVC/1/Root",@"C:\Program
Files\Soft","WebServices",out sError);
Console.WriteLine(sError);
But I am getting following errors:
System.Runtime.InteropServices.COMException (0x80070003): The system
cannot find the path specified
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_IsContainer()
at System.DirectoryServices.DirectoryEntries.CheckIsContainer()
at System.DirectoryServices.DirectoryEntries.Add(String name, String
schemaClassName)
at System.EnterpriseServices.Internal.IISVirtualRoot.Create(String
RootWeb, String inPhysicalDirectory, String VirtualDirectory,
String&.....
I even tried to create virtual directory using System.DirectoryEntry.
It gives me the same error.
Iam sure C:\Program Files\Soft exists . I am doubtful if Iam making
some mistake in passing first parameter.
Can Somebody please tell me what is going wrong?
Thanking you in advance,
Sudha