programatically setting the ASP.NET version in IIS

Posted on 2006-04-01
Last Modified: 2009-12-16
hi experts,

I came across approaches in creating virtual directory in IIS (worth mentioning are those using IISVirtualRoot of System.EnterpriseServices.Internal and the others using DirectoryEntry class).

With those I am now able to create virtual directories programmatically.

My problem however is that the IIS where I will be deploying the project supports both .NET 1.1 and 2.0

Is there a way to programmatically select the .NET version that the virtual directory will use?

Would appreciate any help.

Question by:steelheart38
    LVL 14

    Accepted Solution

    Have a look at this url. It's pretty similair from what you want:
    LVL 13

    Assisted Solution

    Not like you can with a managed assembly where you can put the requiredRuntime attribute in the app.config file.  I dunno this does seem like a big deployment issue to me. Its a value in a drop down box but maybe deployment is out of your hands...

    Im not sure what all the code in the link above was about but if you want to determine the version of any .NET application including at runtime use,


    It will tell you what version your currently under.  So you can check the version in the application startup.
    LVL 7

    Author Comment

    Thanks for you help guys

    I was able to come across the solution that closest fits my needs. I hope you will understand if I am requesting for reduction of points to be given since I found the solution already yet as you have somehow led me to the solution I will still be giving out points.

    More power to you two

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now