locked
Problem with trying to deploy mvc 5 site to iis 7.5 RRS feed

  • Question

  • User1925606831 posted

    I apologize in advance for the long post. I've been working on a fairly simple ASP.NET MVC 5 site (Simple CRUD) using EF 5.0 and Oracle's ODP.NET 4.112.4.0. I am using VS2013 on an 64 bit machine and it is to deploy to IIS 7.5 running on a Windows 2008 r2 Server. I set my build status to x86 as that is what is registered in the C:\Windows\Assembly on the target machine. I ensured that the version of Oracle.DataAccess.dll is also a 32 bit version and that it matches version number to what is registered on the target server. (You can tell I've been stumbling around this awhile.) When I build it, I can run it on my local machine's IIS Express installation with no problems. Every page renders, it looks fantastic, it all works as designed. If only I could leave it running on my dev machine and point the users to that....

    When I deploy it over to the production server. I use Web Deploy and I copy over all of the files. The Oracle.DataAccess.dll is set to Copy Local="True" just to be safe. It builds and publishes correctly, but the site gives me the following error:

    Could not load file or assembly 'Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342'. This assembly was compiled for a different processor.

    Exception Details: System.BadImageFormatException: Could not load file or assembly 'Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342'. This assembly was compiled for a different processor.

    Stack Trace: [BadImageFormatException: Could not load file or assembly 'Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342'. This assembly was compiled for a different processor.] System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +34 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +16 System.Reflection.Assembly.Load(String assemblyString) +28 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38 [ConfigurationErrorsException: Could not load file or assembly 'Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342'. This assembly was compiled for a different processor.] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +752 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +218 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170 System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +91 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +285 System.Web.Compilation.BuildManager.ExecutePreAppStart() +153 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516 [HttpException (0x80004005): Could not load file or assembly 'Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342'. This assembly was compiled for a different processor.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9913572 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.184

    I have the application in its own file and as its own site. The Application Pool is version 4.0.30319 and pipeline mode is Integrated. I've also enabled 32-bit applications on this pool. I've been researching in vain trying to determine what else I need to do to get this situated, so I'm coming here and to asp.net to see if someone else can help me see what I've been missing.

    Cheers,

    Wednesday, May 21, 2014 12:01 PM

All replies

  • User-1454326058 posted

    Hi Tony,

    I think you should install Oracle Data Access Components on your server. More information, please refer to:

    # Entity Framework, LINQ and Model-First for the Oracle Database

    http://download.oracle.com/oll/obe/EntityFrameworkOBE/EntityFrameworkOBE.htm

    On the other hand, this issue is related to Oracle ODP.NET, it isn’t supported here. I suggest that you should post it Oracle Support site for efficient response.

    Thanks

    Best Regards

    Thursday, May 22, 2014 2:03 AM
  • User1925606831 posted

    Star,

    thanks for the reply. We do have the ODAC framework on the server, which is why I was careful to match the dll file that I have referenced to be the same as the version on the server, specifically the one which is registered in the GAC.

    The reason I brought this here and not to the Oracle forums is because it does work perfectly on the development machine, but is not deploying through the Visual Studio deployment tools. So I figured that this is something which may be a setting somewhere in my files or maybe something quick on the server. I don't see that this problem is specifically a odp.net issue.

    Thanks again,

    Tony

    Thursday, May 22, 2014 12:41 PM
  • Thursday, May 22, 2014 10:44 PM
  • User1925606831 posted

    I read those and tried the one from the Oracle thread. The only response I get is if I take the Copy Local to false when I rebuild. Then I get the front page to come up with no css. I can get the CSS to render properly by not using the Bundle configs and call the files directly from the _Layout.cshtml view. However, the error remains for every other page in the site, since they all have to go to the database to collect their info.

    Friday, May 23, 2014 10:21 AM