locked
Web.config error on .Net Framework version with Windows 2008 R2 RRS feed

  • Question

  • User-830563764 posted

    We just upgraded the Windows Server 2003R2 to 2008R2.  We havd been using Visual Studio 2005, 2008, and 2010.  Most of our ASP.NET programs run well on Windows Server 2008R2.  Some programs displayed the Server Error as shown below. 
    My understanding is Windows Server 2008R2 runs .NetFramework 2.0, 3.5, and 4.0 autiomatically.  It seems to me the ASP.NET programs with the following Windows Server 2008R2 error are the ASP.NET programs I started from the old ASP.NET 1.1. or 2.0.  Although these old ASP.NET programs ran well in Windows Server 2003R2 after upgraded to VS2008/2010 (i.e. ASP.NET 3.4 and 4.0), they failed with Windows Server 2008R2. 
    Reviewing the Web.Config files showed the failed programs have a different configuration file.  How can I solve this problem?
    Thanks, Jeffrey  

    Server Error in '/xxxxxxxx' Application.


    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive. Source Error:

    Line 20:           debugging ASP.NET files.
    Line 21:     -->
    Line 22: <compilation defaultLanguage="vb" debug="true" targetFramework="4.0"/> Line 23:     <!--  CUSTOM ERROR MESSAGES
    Line 24:           Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable. 

    Source File: E:\SOMAtest\web.config    Line: 22


    Version Information: Microsoft .NET Framework Version:2.0.50727.5466; ASP.NET Version:2.0.50727.5456

    Friday, February 8, 2013 11:23 AM

Answers

  • User-718146471 posted

    You have to ensure your application pool is asp.net 4 because it could be configured for dot net 2/3/3.5

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, February 8, 2013 11:31 AM

All replies

  • User-718146471 posted

    You have to ensure your application pool is asp.net 4 because it could be configured for dot net 2/3/3.5

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, February 8, 2013 11:31 AM
  • User-830563764 posted

    Our Application Pools showed an ASP.NET v4.0 (Integrated) and an ASP.NET v4.0 Classic (Classic).
    There is also a defaultAppPool, set to v2.0.  I changed it to v4.0.  Then the error msg was gone.

    Thanks.

    Friday, February 8, 2013 11:48 AM
  • User-830563764 posted

    Our Application Pools showed an ASP.NET v4.0 (Integrated) and an ASP.NET v4.0 Classic (Classic). There is also a defaultAppPool, set to v2.0. I changed it to v4.0. Then the error msg was gone.

     

    The error msg was gone when I was with remote desktop of the web server. However, when I ran from my workstation,
    all the ASP.Net progarms failed.  I immediately changed the defaultAppPool back to v2.0.  Then everything worked fine.
    Don't understand why????

     

     

    Friday, February 8, 2013 12:21 PM
  • User-718146471 posted

    If it happens again, I would suggest you post the symptoms in the iis forums at http://forums.iis.net since there could be some wierdness going on under the surface.

    Friday, February 8, 2013 12:24 PM
  • User1786833724 posted

    Hello, Is there need to test the .NET version installed on the client machine ? If I am not wrong we need to have it just on the server machine correct ?

    And on the server we can always check using some regisrty to find if & what .net version is installed on the server using code underneath. But I am still trying to figure out if, this pre-requisites check will avoid some issues like, application pool on the server, is asp.net 4 or not and such ?

     

     

    //Get OS
                System.OperatingSystem OsInfo = System.Environment.OSVersion;
                Console.Write("OS :\n" + OsInfo.Version + " " + OsInfo.VersionString + " " + OsInfo.Platform + " " + OsInfo.ServicePack);
                //Get OS Architecture
                bool is64OS = System.Environment.Is64BitOperatingSystem;
                Console.Write("64 Bit ? : " + is64OS.ToString() + "\n\n\n");
    
                //Get Installed Programs
                string regKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
                int noOfApplicaitons = 0;
                using (Microsoft.Win32.RegistryKey key = Registry.LocalMachine.OpenSubKey(regKey))
                {
                    foreach (string subKeyName in key.GetSubKeyNames())
                    {
                        using (RegistryKey subKey = key.OpenSubKey(subKeyName))
                        {
                            if (subKey.GetValue("DisplayName") !=null && !subKey.GetValue("DisplayName").Equals(string.Empty))
                                Console.WriteLine(subKey.GetValue("DisplayName"));
                            noOfApplicaitons++;
                        }
                    }
                }
                Console.Write("\n\n\nTotal No of known packeges installed in this system : " + noOfApplicaitons.ToString());

    Friday, February 15, 2013 10:06 AM
  • User-718146471 posted

    You shouldn't need to check the framework on the client system.

    Friday, February 15, 2013 10:22 AM
  • User1786833724 posted
    1. Okay but I do need to check on server. And is there a way I can find programatically, the app pool's f/w & pipeline info , for the pool which is going to be used by my applicaiton ? I am just wanting to have a console app that I can run and ,rely, on jsut before deploying / upgrading the customer or applying an update.
    2. Also in the program files how can I find the .net 's installation directory ?
    Friday, February 15, 2013 10:28 AM
  • User-718146471 posted

    You can try searching on Google for powershell scripts that will give you all that information. We really can't give console app advice here since that is not related to asp.net.

    Friday, February 15, 2013 10:42 AM
  • User1786833724 posted

    Thanks ! I appreciate your time.

    Friday, February 15, 2013 10:48 AM