I had a problem loading a .dll which I subsequently fixed – the application runs just fine.
The problem I am having is in Visual Studio 2010. When I open a view page, the top line with the class details:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<TPS.Models.CashCarrierCoverViewModel>" %>
has a blue error underline, and it tells me that this old problem is still a problem, namely:
“Could not load file or assembly X or one of its dependencies. An attempt was made to load a program with an incorrect format.”
The original problem was x86 vs x64 issue – now resolved. But this error still occurs on the view pages which means I can’t develop with Intellisense. This is obviously unworkable.
Most searches on this error deal with the original problem, not this Visual Studio error. I’ve triple checked I have the right .dll, confirmed by app working, I’ve confirmed it’s copied into the bin folder. I’ve restarted VS 2010, I’ve rebooted the PC.
I solved it.
The assembly that was causing the trouble was Oracle.DataAccess. After reading this post, I decided to use the Oracle installer to uninstall the x64 and x86 versions (I mistakenly installed x86 first, which apprently caused the error to begin with). I then reinstalled the x64 version. I did a ReBuild, a Clean, deleted the items in the solution obj folder, then restarted the PC. When I started Visual Studio it appeared to do some reloading of intellisense which took a few seconds after which it was all fixed.