Reference: http://www.cnblogs.com/joey0210/archive/2012/09/29/2708420.html previous article on the DLL reference problem, mainly said that the program if the use of reflection, The DLL that reflects the creation of the object must be placed in the bin directory of the Web application. Today, a similar problem was encountered, when the MVC3 application, published to IIS, reported: "Failed to load file or assembly" oracle.dataaccess "or one of its dependencies. An attempt was made to load a program that is not properly formatted. “。 The reason is simple, because when I sent the project, Oracle provided ASP. NET access to the Oralcle database this Oracle.DataAccess.dll local copy is not set to True (the reference is found in the project reference, and the right-click property has this " Local Replication "). It is not automatically copied to the bin directory when it is released. Thus, the error that failed to load is shown. All right! In that case, I would either refer to the property in the project or simply copy the DLL to the bin directory that was published on the server. After I copied it, the problem came back, or the mob failed to load a reference. Then I think I IIS is located on the server is 64, and my odp.net is loaded 32. So the corresponding Oracle.DataAccess.dll should also be 32 bits, which involves the configuration of IIS.
DLL has, 32-bit, the system is 64-bit. This has a setting in IIS as follows:
Let's take a look at which application pool the project uses:
Then go to the application pool to configure
Set enable 32-bit application to True
OK, fix it. Then browse everything normal.
Here are also notes on the deployment of the MVC3 application in IIS7:
1. Add MVC Parsing
First make sure that the ASP. NET MVC3 is installed, and then check the site's handler mappings to see if the following mappings exist:
extensionlessurlhandler-integrated-4.0
Extensionlessurlhandler-isapi-4.0_32bit
Extensionlessurlhandler-isapi-4.0_64bit
If the mapping exists, check to see if the application is assigned to the. NET Framework4.0 application pool.
If the mapping does not exist, you can register with the administrator to run the following command:
32-bit machine:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe-i
64-bit machine:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe-i
2. Then check the bin directory for SYSTEM.WEB.MVC. DLL. If not, copy it in, or follow the method above to regenerate the project.
3.ASP. NET version selection 4.0.30196;
"Failed to load file or assembly" oracle.dataaccess "or one of its dependencies