Search code examples
iisiis-7.5virtual-directory

Create virtual directory in IIS 6 and IIS 7/7.5 using C#


I have installer that will create virtual directory.

It works fine on IIS 6.

But if I try on IIS 7.5 it crashes.

Then i tried using Microsoft.Web.Administration class

But now it will work only on IIS 7 and IIS 7.5

Can anyone help me out so that my code works for both IIS 6 and IIS 7.5?


Solution

  • Finally I have created 2 separate classes for managing IIS6 and IIS7.5.

    And its working fine.