18

I'm deploying my website on the server.

My website is done using asp.net c# 4 and EF 4.

I receive this error:

Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

Any idea how could I fix it?

TylerH
  • 19,065
  • 49
  • 65
  • 86
GibboK
  • 64,078
  • 128
  • 380
  • 620

6 Answers6

21

It looks like you're trying to run it on a version of ASP.NET which is running CLR v2. It's hard to know exactly what's going on without more information about how you've deployed it, what version of IIS you're running etc (and to be frank I wouldn't be very much help at that point anyway, though others would). But basically, check your IIS and ASP.NET set-up, and make sure that everything is running v4. Check your application pool configuration, etc.

Jon Skeet
  • 1,261,211
  • 792
  • 8,724
  • 8,929
  • Thanks Jon for your answer, hosting company is running for the server IIS 7.5 and Windows Server 2008. could be a problem of the hosting provider that has a pool set to not v4? – GibboK Oct 08 '11 at 08:45
  • @GibboK: Does the hosting company *claim* to support ASP.NET v4? They may not even have .NET 4 installed... it sounds like you need to be talking to them directly. – Jon Skeet Oct 08 '11 at 18:30
  • Thanks Jon, we are working on the problem with the hosting company... it seems that .net 4 was uninstalled four our pool. Thanks for your time on this question. – GibboK Oct 10 '11 at 06:43
5

check below link in which you can download suitable AjaxControlToolkit which suits your .NET version.

http://ajaxcontroltoolkit.codeplex.com/releases/view/43475

AjaxControlToolkit.Binary.NET4.zip - used for .NET 4.0

AjaxControlToolkit.Binary.NET35.zip - used for .NET 3.5

nobody
  • 19,010
  • 17
  • 53
  • 73
Vimal Patel
  • 81
  • 1
  • 3
4

Just Add AjaxControlToolkit.dll to your Reference folder.

On your Project Solution, Right Click on Reference Folder > Add Reference > browse AjaxControlToolkit.dll.

Then build.

TylerH
  • 19,065
  • 49
  • 65
  • 86
Crimsonland
  • 2,134
  • 3
  • 24
  • 40
3

Might sound obvious but do you definitely have AjaxControlToolkit.dll in your bin?

Dave Hogan
  • 3,165
  • 4
  • 28
  • 53
  • 2
    I think it's there, otherwise there wouldn't be an error message of: "This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded" – Jon Skeet Oct 08 '11 at 08:37
  • I completely missed the second sentence of that error. Didn't see the scrollbars. It that case it does sound like an older version of NET :) – Dave Hogan Oct 08 '11 at 08:42
  • DaveHogan do you mean hosting provider is running an older version of asp.net? – GibboK Oct 08 '11 at 08:49
0

If you are working with Source safe then make a new directory and take the latest there, this solved my issue...thanks

Devendra Patel
  • 185
  • 1
  • 9
0

Right click in Project / Clean

That always works for me

Michael Aguilar
  • 668
  • 7
  • 15