programatically setting the ASP.NET version in IIS

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.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
steelheart38Author Commented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.