deployment problem: web application runs on windows7/IIS 7, not on WIndows 2008/IIS7

aatjan
aatjan used Ask the Experts™
on
HI,

I made an webapplication which runs fine on a windows 7 (64 bits) /IIS7 combination. App pool is asp.net 4, integrated, 32 bits apps allowed.

I want to deploy this app to windows 2008 r2 (64bits) /IIS7. Same app pool settings. So i copied the files from the WIndows 7 machine to the windows2008 r2 machine.

Now i'm facing with an error message like xxx.dll cannot be loaded, bad image format.

What could be the problem?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Aaron TomoskyDirector of Solutions Consulting

Commented:
.net version? Mvc? Something you installed included that dll it sounds like

Author

Commented:
Asp.net 4.0, no mvc.
Aaron TomoskyDirector of Solutions Consulting

Commented:
What is the xxx.dll? Usually a search for that tells you what's missing
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

Author

Commented:
Hi,  the xxx.dll is not missing. It has a bad image frmat.
Aaron TomoskyDirector of Solutions Consulting

Commented:
Let me try again:
Usually a search for whatever the error message is will give you insight to the solution. Can you please tell us the exact error message?

Author

Commented:
Could not load file or assembly 'amzinet' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.BadImageFormatException: Could not load file or assembly 'amzinet' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Assembly Load Trace: The following information can be helpful to determine why the assembly 'amzinet' could not be loaded.


WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

 

Stack Trace:


[BadImageFormatException: Could not load file or assembly 'amzinet' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +132
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +144
   System.Reflection.Assembly.Load(String assemblyString) +28
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46

[ConfigurationErrorsException: Could not load file or assembly 'amzinet' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +618
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +209
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
   System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +94
   System.Web.Compilation.BuildManager.CallPreStartInitMethods() +332
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +677

[HttpException (0x80004005): Could not load file or assembly 'amzinet' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9106712
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258

Thanks!
Aaron TomoskyDirector of Solutions Consulting

Commented:
Did you follow these instructions:
http://www.amzi.com/manuals/kw4/runtime/aspnet_interface.html

It says you need to copy some files to windows/system32

Author

Commented:
Hi. This is for asp.net 1...  
We are running on asp.net 4
Aaron TomoskyDirector of Solutions Consulting

Commented:
I don't think so.
"Cannot find amzinet.dll or one of its dependencies
If you get the error that ASP.NET cannot find amzinet or one of its dependencies, it is likely because amzi.cfg, amzi.dll, aosutils.lsx and/or aodbc.lsx were not copied to the windows/system32 directory"

Try this and reboot.
Commented:
Hi,

I did: no result.

Then i read the message carefully;-
WRN: Assembly binding logging is turned OFF.

I turned it on and discovered that IIS was running its 32 bits version, despite of the fact that the app is a 64 bits version. So i changed the apppool settings. This changed the world.

Problem solved.

Author

Commented:
the fusion viewer showed that IIS was running in 32 bits. That does not work if the app itself is a 64 bits version.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial