Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Trying to run .Net 2.0 application in Visual Studio 2012 getting following error

Trying to run .Net 2.0 application in Visual Studio 2012 getting following error

Scheduled Pinned Locked Moved ASP.NET
csharpwindows-adminhelpvisual-studiowpf
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    indian143
    wrote on last edited by
    #1

    Hi, I have .Net 2.0 application I opened it in VS2012 its opening properly. I have set the target property v2.0 only and in IIS also I have set the application pool target to v2.0. But still I getting the following error when I am trying to run the application. Please help me in resolving the error.

    Server Error in '/apps/cnpweb/zzfdpsource/ORFdpProd' Application.

    Could not load file or assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IO.FileLoadException: Could not load file or assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

    Stack Trace:

    [FileLoadException: Could not load file or assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
    System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +0
    Sys

    P S 2 Replies Last reply
    0
    • I indian143

      Hi, I have .Net 2.0 application I opened it in VS2012 its opening properly. I have set the target property v2.0 only and in IIS also I have set the application pool target to v2.0. But still I getting the following error when I am trying to run the application. Please help me in resolving the error.

      Server Error in '/apps/cnpweb/zzfdpsource/ORFdpProd' Application.

      Could not load file or assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
      Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

      Exception Details: System.IO.FileLoadException: Could not load file or assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

      Source Error:

      An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

      Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

      WRN: Assembly binding logging is turned OFF.
      To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
      Note: There is some performance penalty associated with assembly bind failure logging.
      To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

      Stack Trace:

      [FileLoadException: Could not load file or assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
      System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +0
      Sys

      P Offline
      P Offline
      puja11191
      wrote on last edited by
      #2

      Though I am not very sure, but we had a similar problem in our project. If we choose the framewrok to 4.0 (the project was supposed to run in 3.5), we used to get these errors. To resolve it go to your web.config file and change the 4.0.0.0 to 2.0.0.0. It worked for us! Hope it helps :)

      I 1 Reply Last reply
      0
      • P puja11191

        Though I am not very sure, but we had a similar problem in our project. If we choose the framewrok to 4.0 (the project was supposed to run in 3.5), we used to get these errors. To resolve it go to your web.config file and change the 4.0.0.0 to 2.0.0.0. It worked for us! Hope it helps :)

        I Offline
        I Offline
        indian143
        wrote on last edited by
        #3

        Hi, Where in the Web config we have to change the version from 4.0.0.0 to 2.0.0.0, I am not seeing any where that I am setting it to 4.0.0.0. Can you please point me the element name in the Web config I have to do it? Thanks in advance.

        Thanks & Regards, Abdul Aleem Mohammad St Louis MO - USA

        P 1 Reply Last reply
        0
        • I indian143

          Hi, Where in the Web config we have to change the version from 4.0.0.0 to 2.0.0.0, I am not seeing any where that I am setting it to 4.0.0.0. Can you please point me the element name in the Web config I have to do it? Thanks in advance.

          Thanks & Regards, Abdul Aleem Mohammad St Louis MO - USA

          P Offline
          P Offline
          puja11191
          wrote on last edited by
          #4

          Try searching in your web .config file. Otherwise if possible please post the web .config file here. So that I can have a look

          1 Reply Last reply
          0
          • I indian143

            Hi, I have .Net 2.0 application I opened it in VS2012 its opening properly. I have set the target property v2.0 only and in IIS also I have set the application pool target to v2.0. But still I getting the following error when I am trying to run the application. Please help me in resolving the error.

            Server Error in '/apps/cnpweb/zzfdpsource/ORFdpProd' Application.

            Could not load file or assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
            Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

            Exception Details: System.IO.FileLoadException: Could not load file or assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

            Source Error:

            An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

            Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

            WRN: Assembly binding logging is turned OFF.
            To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
            Note: There is some performance penalty associated with assembly bind failure logging.
            To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

            Stack Trace:

            [FileLoadException: Could not load file or assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
            System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +0
            Sys

            S Offline
            S Offline
            smepperson
            wrote on last edited by
            #5

            This is the same problem I had two days ago and it took me way too long to figure out. If you right click the project in Visual Studio and go to Property Pages you will see the targeted framework. You have said that your's is targeted correctly however under MSBuild Options make sure that you do not have any of the checkboxes checked. It took me forever to figure out that I had one checked off and it was interfering with testing in the browser. Hope this helps.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups