IIS 7 and Above
Configuration & Scripting
Create Virtual Directory programmatically, compatible with all IIS ve...
Last post Aug 21, 2011 02:52 PM by Guy Roland
Mar 06, 2009 11:03 AM|laszlozoli|LINK
Mar 09, 2009 02:07 AM|lextm|LINK
Mar 09, 2009 02:10 AM|steve schofield|LINK
Do you have the IIS 6 compat stuff installed? My test box has these installed and creates the vdir in the metabase and applicationHost.config. The only issue I have is getting the vdir to display in IIS Manager. I tried an iisreset without issues.
Windows Server MVP - IIS
Log archival solution
Install, Configure, Forget
Mar 10, 2009 07:24 PM|laszlozoli|LINK
Because I don’t want to have two different application. I don’t want to bother the user to with the IIS details.
If I use two different methods for IIS6 and IIS7
1) I need to detect if it is installed the IIS6 or IIS7 on the computer
2) I should load somehow dynamically the dlls for the DirectoryEntry or for the ServerManager if it is possible
I hope that I can find a better solution. That’s why I asked this question. :)
Mar 10, 2009 07:31 PM|laszlozoli|LINK
Thank you for your advice. I will try to install all the IIS6 related things.
Mar 13, 2009 09:05 AM|laszlozoli|LINK
Thank you once again.
I installed the IIS6 management compatibility and is working without any problem with the stuff I implemented for the IIS6.
Now I should find a way to detect if the IIS6 compatibility is installed.
Jul 17, 2009 10:10 AM|asadaoui|LINK
I have some autorizations problems with your application which creates Virtual Directory!
[UnauthorizedAccessException: Accès refusé. (Exception de HRESULT : 0x80070005 (E_ACCESSDENIED))] System.DirectoryServices.Interop.IAds.SetInfo() +0 System.DirectoryServices.DirectoryEntry.CommitChanges() +66
I understood that I need permissions to add Virtual Directories, but I'm administrator in my computer,
So I have all permissions I guess.
Thanks for your help
Jul 18, 2009 10:07 AM|lextm|LINK
Windows Vista and Server 2008 introduces User Access Control. Once your application runs in elevated mode, then it will have enough permissions.
Please read about them from MSDN. There are a lot of articles.
Aug 21, 2011 02:52 PM|Guy Roland|LINK
Has anyone tried to programatically create a virtual directory that redirects to a url? …ie another site altogether?