Re: Create Virtual Directory in IIS using VB.NET
Hi Woka..
I only registered to this site to say thank you for the post. Two years later and it's still working and helping people like me. Thank you to all of you. I rewrite the code in c# but for some reason I couldn't figure out it's not working. So I decided to write it in VB.Net and use it as a DLL, which is working perfectly. Weird isn't it?
---
Sergio
Re: Create Virtual Directory in IIS using VB.NET
I was wondering if anyone knows how to add an IIS 6 web site with Host Header?
Re: Create Virtual Directory in IIS using VB.NET
Hi Woka! Thanks for letting us use the code I really appreciate it. The code seemed to be working when I was running it through visual studios, but after we uploaded onto the server I am getting the RPC unavailable error. I'm not sure what to do to fix this, we checked the firewall and are logging in as administrator so I'm not sure what else can be the problem. Do you have any ideas? Here is the stack trace error that follows:
[COMException (0x800706ba): The RPC server is unavailable.
]
System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) +377678
System.DirectoryServices.DirectoryEntry.Bind() +36
System.DirectoryServices.DirectoryEntry.get_AdsObject() +31
System.DirectoryServices.PropertyValueCollection.PopulateList() +26
System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName) +49
System.DirectoryServices.PropertyCollection.get_Item(String propertyName) +150
MFC.WebApp.SecureAuth.WebAdminWorkflow.CreateVirtualDir(String WebSite, String AppName, String Path) +192
MFC.WebApp.SecureAuth.WebAdminWorkflow.AddInstanceButton_Click(Object sender, EventArgs e) +239
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Re: Create Virtual Directory in IIS using VB.NET
Nevermind I found what was wrong. I was hardcoding the name for my box while I was coding instead of putting the localhost name. Everything seems to be working fine now
Re: Create Virtual Directory in IIS using VB.NET
Hi mate
I dont know how old is this post. the code you wrote is great and works for me like charm the only problem is that i want to add the physical path credentials to the virtual directory with your code but i couldnt find anywhere what property should i use.
greatest regards