James
James

Reputation: 21

How do I get .NET 4.0?

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.

Upvotes: 2

Views: 217

Answers (4)

Jamie Keeling
Jamie Keeling

Reputation: 9966

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

Upvotes: 5

Abhijeetchindhe
Abhijeetchindhe

Reputation: 400

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

Upvotes: 0

JacquesB
JacquesB

Reputation: 42689

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.

Upvotes: 2

Paul Aldred-Bann
Paul Aldred-Bann

Reputation: 6020

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

Upvotes: 0

Related Questions