473,327 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

C#-MSI Set ASP Version on Virtual Directory

6
Need to create virtual directories from a MSI .dll. Code is working fine now but when I install on a clean machine it's defaulting to ASP version 1.1. Need to find a way to set to 2.0. Current code is below...

DirectoryEntry deRoot = new DirectoryEntry("IIS://localhost/W3SVC/1/Root");
deRoot.RefreshCache();
DirectoryEntry deNewVDir = deRoot.Children.Add("NewDir", "IIsWebVirtualDir");
deNewVDir.Properties["Path"].Clear();
deNewVDir.Properties["Path"].Insert(0, NewDirPath);
deNewVDir.CommitChanges();
deRoot.CommitChanges();
deNewVDir.Invoke("AppCreate", true);
deNewVDir.CommitChanges();
deRoot.CommitChanges();
deNewVDir.Close();
deRoot.Close();


Any ideas?
Feb 14 '08 #1
1 1350
Yonger
6
This is the only way I've been able to get it to work...but seems to be working for me.

ProcessStartInfo p = new ProcessStartInfo("C:\\WINDOWS\\Microsoft.NET\\Fram ework\\v2.0.50727\\aspnet_regiis.exe");
p.Arguments = " -s W3SVC/1/Root/NewDirPath";
p.UseShellExecute = false;
p.CreateNoWindow = true;
Process proc = new Process();
proc.StartInfo = p;
proc.Start();

basically just calling the aspnet_regiis from the directory of the version of .NET I want the app to be using.
Feb 14 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Mark Hoagland | last post by:
I've got a scenario with a web application where I must access the virtual directory being accessed from within the Application_OnStart event handler. Specifically, I have a series of IIS virtual...
8
by: nick | last post by:
I have a problem and I've been using a cheezy work around and was wondering if anyone else out there has a better solution. The problem: Let's say I have a web application appA. Locally, I set...
0
by: J Smithers | last post by:
What specific additional security is afforded by providing access to files through an IIS Virtual directory - as compared to simply providing access to the files "in the site" (i.e., under the site...
0
by: bpssolutions | last post by:
hi- i'm going mad over here. any help would be greatly appreciated. aspnet_wp.exe hangs whenever i browse to the virtual directory in which i am developing, sucking up all CPU time. any...
8
by: Nate | last post by:
I am running on Window 2003. I have a website built in ASP.NET 2.0. I need to have a Virtual Directory running an application in 1.1. I have configured each in its own Application Pool. The 1.1...
8
by: Rak | last post by:
I am looking for a way to programatically change the .net version of the virtual directory that I am creating within a aspx page. As part of creating a new customer in my asp.net 2 application, it...
1
by: Rak | last post by:
Can I use aspnet_regiis to change the .NET Version of a remote IIS virtual directory? If yes, how can I do it. If not, what options do I have to do it programatically? Currently I have an...
3
by: Jav | last post by:
V2005, Windows xp Prof, asp.net newbie I am having a devil of a time starting an asp.net app. Here's what I'm doing. 1. Create a Folder (TestSite) in Visual Studio 2005\Projects\WebSites 2....
1
by: =?Utf-8?B?bWlrZXM=?= | last post by:
I am writing a C# Windows Application that will create virtual directories on our Win 2003 server machines. Using the System.DirectoryServices DirectoryEntry class I have had very little trouble...
0
by: Crash | last post by:
..NET Framework 1.x, 2.x, 3.x... ASP.NET 5.0, 5.1, 6.0... Windows Server 2000, XP, Server 2003... I am using NAnt & the NAnt contrib library to automate virtual directory maintenance tasks on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.