1

I looked up Microsoft .NET 4.0 and I downloaded 2 things. the web installer and client profile but according to the bottom of this picture, I don't have it.

Screenshot of error

The error message is:

Could not load file or assembly App_Code or one of dependencies. This assembly is bui;t by a runtime newer than the currently loaded runtime and cannot be loaded.

CodesInChaos
  • 106,488
  • 23
  • 218
  • 262
James
  • 11
  • 1
  • 1) This looks like ASP.net, so client profile won't be enough 2) It's possible that you have .net 4 installed, but the used runtime is still 2.0. – CodesInChaos Jul 31 '12 at 09:12
  • Read the bottom line of the error message: the App Pool is running .NET 2 CLI (ie. V2, V3 or V3.5 framework). – Richard Jul 31 '12 at 09:15

4 Answers4

4

Have you checked the value of the '.NET Framework Version' column for your Application Pool via IIS?

Application Pool Config

To change this:

  1. Open IIS Click on the 'Application Pools' level within the tree structure you see on the left hand side of the application
  2. Right click on your application pool in the list and select 'Basic Settings'
  3. Change the value of the 'Net framework version' to be v4.0
  4. Press 'OK' for the changes to be applied and the app pool will recycle ready for use
Jamie Keeling
  • 9,806
  • 17
  • 65
  • 102
2

An existing web application will continue to run .net 2.0 since the frameworks are installed side-by-side. You have to explicitly configure the app pool to run 4.0.

JacquesB
  • 41,662
  • 13
  • 71
  • 86
0

Make sure your application pool in IIS (I assume you're using IIS) is set to .NET 4.0 (it sets itself to 2.0 by default). Failing that you could always try re-registering .NET with IIS:

  1. Open command prompt
  2. Enter the following: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
  3. Press enter
Paul Aldred-Bann
  • 5,840
  • 4
  • 36
  • 55
0

1st Solution.

2nd Solution

And Make sure your IIS application pool is set to .NET 4.0, for help regarding that.. Check this.

MSDN help

Community
  • 1
  • 1
Abhijeetchindhe
  • 400
  • 2
  • 15