.NET Framework Bookmark and Share   
 index > 64-Bit .NET Framework Development > System.BadImageFormatException:is not a valid Win32 application
 

System.BadImageFormatException:is not a valid Win32 application

We are facing problem while migratinga .Net 2.0 application64 Bit OS Windows Server 2003.
The error is as below:

"is not a valid Win32 application. (Exception from HRESULT: 0x800700C1) "

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: is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

the application is running fine on 32 Bit OS windows Server 2003.

Can any one provide any possible soution to the above problem.

thanks
Nikhil

Nikhil001
Your app is trying to load a 32-bit DLL into a 64-bit process. That's not possible. Either force the process to run in 32-bit mode or upgrade the DLL. You gave no details that would help anybody help you find the name of that DLL.

Hans Passant.
nobugz
Your app is trying to load a 32-bit DLL into a 64-bit process. That's not possible. Either force the process to run in 32-bit mode or upgrade the DLL. You gave no details that would help anybody help you find the name of that DLL.

Hans Passant.
nobugz
Hi

There is no specific dll name mention in the error details please find the complete error details a below

is not a valid Win32 application. (Exception from HRESULT: 0x800700C1) 
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: is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

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.  

Stack Trace: 


[BadImageFormatException:  is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)]
   System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
   System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +416
   System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +166
   System.Reflection.Assembly.Load(String assemblyString) +35
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +190

[ConfigurationErrorsException:  is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +11195528
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +388
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +232
   System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +48
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +210
   System.Web.Compilation.WebDirectoryBatchCompiler..ctor(VirtualDirectory vdir) +191
   System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors) +54
   System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +295
   System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +476
   System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +116
   System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +175
   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +52
   System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +50
   System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +503
   System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +142
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +263

 
thanks
Nikhil

Nikhil001
If you have no clue at all, use something like SysInternals' Process Monitor utility to see what file is getting loaded.

Hans Passant.
  • Proposed As Answer bysöve Wednesday, August 12, 2009 3:53 PM
  •  
nobugz
I am having the same issue. I searched on various sites, but am not able to figure this out. Have you found any solution to this? If so, please let me know.

-k
kmehta
Goto http://forums.asp.net/t/983377.aspxand look at David Walker's solution near the bottom of the page...I took this went step further and createda new app pool specifically for 32 bit. Hope this helps.

-Nick
Nick.Nguyen
I had looked at that log (thanks for the link, though), but we are using IIS 6.0 on Windows Server 2003 SP2. Hence, I don't see Advance setting in AppPool.

Any further help would be appreciated! Thanks for the help.

-k
kmehta

You can use google to search for other answers

Custom Search

More Threads

• Attempted to load a 64-bit assembly on a 32-bit platform while refering Sharepoint.dll
• what is 64 bit application
• Targeting both 32bit and 64bit with Visual Studio in same solution/project
• Error about installing Jet 4.0 Service Pack 8 (SP8) for Windows Server 2003 64 Bit Edition (KB829558)
• Plans for supporting .NET v3.5 on Itanium 64-bit machines?
• SQL Server not compatible with .net Framework x64?
• OWC11.Spreadsheet.11 - Retrieving the COM class factory for component with CLSID {} failed due to the following error: 80040154.
• 800a01ad "activex component can't create object" in ASP on x64
• Can Express compile 64 bit apps?
• QI Works, but object is null