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

Hello,

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
LVL 5
MohitPanditAsked:
Who is Participating?
 
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
0
 
Ronak PatelCommented:
Hi,

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


Regards,
Ronak
0
 
MohitPanditAuthor Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.