ASP.NET: exception Could not load file or assembly (as built by a runtime newer than the currently loaded runtime)


I've upgraded one application from framework 2.0 to framework 4.0.

I've tested at my local environment to set website 4.0 in IIS and it was working fine.

But, when it went to customer production environment, it is giving below error:

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

Could you please share your thoughts to resolve aforesaid issue?

Best Regards
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ronak PatelCommented:

Check the installed .Net framework version on the production server. It has to be same as your local environment.

MohitPanditAuthor Commented:
It was same .net framework version i.e. production vs. local environment.

Actually, I have three virtual directory over IIS server i.e. Website, two webservices.

So, website was pointing to 2.0 framework. I've made changes to website point to 4.0 framework after that it worked.

Best Regards

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MohitPanditAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.