Monday, June 08, 2009 6:01 AM
I have installed VS2010 beta 1 for checking new features though I am still using VS 2008. After installation, now I am unable to set ASP.net version for IIS 6.0 virtual directories to Dot net Framework version2.0 .My virtual directory is located under a new website I created a few days after installing VS2010 beta 1. It is created under “WebSites” and I found ASP.NET framework version is set to: 1.1.4322 automatically for the site. I created a virtual directory under the new website to run my VS2008 project and tried to set the ASP.NET version under the ASP.NET tab in the virtual directory properties. When I select version 2.0.50727 from the drop down and click “Apply” it show me a message “ Changing the Framework version requires a restart of the W3SVC service, alternately you can change the version without restarting the W3SVC service by running aspnet_regiis.exe –norestart –s IIS –Virtual-Path Do you want to continue (this will change the Framework Version and restart the W3SVC service) . I click “OK” and then finally “OK” in the main properties and it show the above message again and then closes the properties form. But when I again open the properties for the virtual directory I found it changed nothing and the framework version is still 4.0.
Can anybody tell me how to change the framework from 4.0 to 2.0 in the above conditions?
- Moved by Aaronru - MSFTMicrosoft Employee Monday, June 08, 2009 5:43 PM This seems to be a more general .NET Framework question. moving to the .NET Framework 4 beta1 general forum. (From:Visual Studio 2010 Install and Setup)
Friday, June 12, 2009 7:54 AM
Though I have not received any answer to my question, I am posting here some new information.
After doing a few experiments it appears to me that there is something happening for what the “aspnet_regiis” is not able to update the configuration setting for the virtual directory (I may be incorrect). Because the virtual directories for which the asp.net version was already set to 2.0 (before installing DotNet framework 4.0 with VS2010 beta1) are working fine. So I tried as my last way to change the configuration in a reverse way. What I did is that I saved the configuration of a virtual directory already set to Asp.net version 2.0 in a XML file. I replaced the source path (actual path) and names and other information wherever required for the new project in that xml configuration file. But I have not changed anything that is generated automatically like the following session key as I don’t know.
<IIS_Global Location ="." SessionKey=""></IIS_Global>
Then I created a new virtual directory and selected the option “virtual directory (from file)”. I selected the xml file and it worked.
I know the above process is totally wrong and technically unacceptable and not a solution. As the new site will be having some key information same as the already existing site (like session key). But what to do as nothing worked and i was unable to work on new VS 2008 projects. I do not want to uninstall VS2010 and check again. I first hesitated to post this (please don’t laugh at me and forgive if I am making thing very much wrong) but thought it may provide some kind of information to solve the issue for any one who is interested and is a expert.
Tuesday, June 16, 2009 6:23 PMFrom a command window, change the directory path to the root of the 2.0 Framework install location. This should be a path something like "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727".
Then run aspnet_regiis to register a specific IIS application with 2.0. For example if the directory of your application is "MyApp", and assuming MyApp is under the Default Web Site, then the command would be:
aspnet_regiis.exe -s W3SVC/1/ROOT/MyApp
As to what is causing this problem - I don't know specifically what is causing it. However we did uncover a number of bugs with the MMC tab for ASP.NET when 1.1, 2.0 and 4.0 were all on the same box and we have made numerous fixes for it for Beta 2.
- Marked As Answer by Karel ZikmundMicrosoft Employee, Moderator Wednesday, June 17, 2009 2:51 PM
Wednesday, June 17, 2009 10:35 AM
Thanks! for the solution, it worked . Otherwise it was very tedious work for me to every time create a new virtual directory first then save it in XML and changing all to 2.0 in the XML file and then again deleting the virtual directory and creating again from xml file.
As the solution you provided is an alternative (if I consider IIS console as the main tool to do that) but a perfect way to change the framework version from 4.0 to 2.0 and as you mentioned accurate solution will be available in .NET Framework 4 Beta 2, I am not sure whether I should mark it as complete answer to my question. So I will request the moderator for this forum to take the decision.
Wednesday, June 17, 2009 3:05 PMModeratorStafan's response solved your problem, so I marked it as 'Answer'.
If you are concerned about this bug and want it to be fixed in final RTM version, I would suggest to report it via MS Connect (as suggested here). That way it will be routed to right team.
If you report it, please describe your environment (which .Net Framwork versions are installed, OS type, etc.).