Could not load file or assembly ':This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded
asp.net-4.0, c#, linq-to-entities
Solution
You have to update your webservice extension to allow framework 4.0 in IIS. To enable the Web service extension for ASP.NET 4.0:
- Click Start, click Control Panel, click System Security, click Administrative Tools, and then click Internet Information Services (IIS) Manager.
- If you need to connect to a remote IIS Server, right click the Internet Information Services node and click the Connect... option.
- Type in the computer name for the remote IIS Server and credentials if necessary.
- Click the Web Service Extensions folder. The security lockdown console appears in the frame on the right.
- In the Web Service Extensions window, right-click the ASP.NET v4.X.XXXX, and then click Allow.
Problem
I Hvea 3 projects in my solution: BL, DL and the UI. All three projectshave a target framework of >NET 4; I have double-checked this by looking at the property page for each project. I am receiving the following error message when I try run the website at the hosting environment but not when I run it locally. ``` Could not load file or assembly 'BL' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. ``` Thanks in advance!