Daniel Fisher (lennybacon.com)

SOA, DATA & THE WEB

ASP.NET Version Issues

I develop with 1.1 and 2.0 - When VS 2003 creates a web solution it is configured to use the 2.0 runtime. Placeing the following code to the Global.asax's of your 1.1 projects and setting execute permissions on the aspnet_regiis.exe helps much.

protected void Application_Start(Object sender, EventArgs e)

{

      if(System.Environment.Version.Major==2)

      {

            System.Diagnostics.Process _p = new System.Diagnostics.Process();

            _p.StartInfo.FileName = "%WINDIR%\\Microsoft.NET\\Framework\\v1.1.4322\\aspnet_regiis.exe";

            _p.StartInfo.Arguments = "-s W3SVC/1/ROOT" + Request.ApplicationPath;

            _p.StartInfo.UseShellExecute = false;

            _p.StartInfo.RedirectStandardOutput = true;

            _p.Start();

      }

}

 

Comments

There is useful tool created by Denis Bauer that allows you to easily switch the asp.net version: http://www.denisbauer.com/NETTools/ASPNETVersionSwitcher.aspx Regards

Write a comment