This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded

Gauls picture Gauls · Jun 15, 2011 · Viewed 23k times · Source

here's what i have got two box one win 2003 server IIS6 another one win2008 server IIS 7.0 I have a standalone app named Util (win app) built in .net 2.0 (VS2005) trying to load .net 4.0 dll/assembly (VS2010). this needed a simple setting in the app which was to create a "Util.exe.config" and add following setting

<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup> 

This will basically make sure .net 2.0 uses the CLR 4.0

works like a charm with in winserver2008 box but shouts with above message within win2003 server???

Any ideas??

@update: Both machines have .net 4.0 framework installed.

Answer

Simon Halsey picture Simon Halsey · Jul 28, 2011

look at the bottom of the yellow screen of death. it'll tell you which runtime version created the error .

Are we talking about a web app? if we are, you need to change the app pool. The above setting will have no affect on what version of the framework a web app uses.

Simon