August 17, 2011

This assembly is built by a runtime newer[...]

When I was trying to run a web service, I suddenly got an error saying, it needs .net Framework 4.0 to be installed first. So I downloaded Framework 4.0 , installed it and then tried to install the web service. Finally I was able to install it successfully...

Once I run the service from the IIS server, it gave an error, "This assembly is built by a runtime newer[...] " exception.... I searched for this issue for a long time, and fianlly got the solution.

This basically happens when the Application pool used by the site is not compatible with the .net framework that it uses internally. I was already using the Default App pool which uses the .net framework 2.0. But the current web service uses Framework 4.0. Finally when I changed the App pool to ASP.NET v4.0 DefaultAppPool, then the web service was working successfully.