.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Win32 exception in application

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :.NET Framework


I am facing "An unhandled win32 exception occurred in ....exe". I tried to used windbg to get some information from crash dump, but it doesn't help much. Furthermore this exception comes only when application runs in release mode.

Appreciate any help in this.


- JC



View Complete Post

More Related Resource Links

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

I'm attempting to migrate an ASP.NET application from .NET 1.1 to 2.0 (and I'm also moving the development platform from VS.NET 2003 to VS.NET 2005). After some modification the application builds cleanly on the new platform but when I attempt to run in debug mode I see the error shown below. I'm building on a new WinXP-64 machine (AMD Athlon 64 CPU).

If I change the target platform to "x86" in the solution properties, I can't build the app (hundreds of unresolved dependencies).

Can anyone point me in the right direction to solve this problem?

Many thanks

Steve F

Server Error in '/CMISWebAdminDevelopment' Application.

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:

Windows 2003 64 bit - Web App gives "is not a valid Win32 application. (Exception from HRESULT: 0x80


I've got an x86 deployment which is targeted at x86 and works fine on 2003 server 32 bit.

When I install on win 2003 x64, the installer works OK, but I cant get the first web page to display.

I've done a fair bit of googling but not found an answer yet

The error message is:

Server Error in '/MyCompany' Application.

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 thro

Enterprise Library: Take Exception To Critical Errors With Custom Application Blocks


Enterprise Library is a collection of application functionality blocks that you can re-use in your application for common functionality you'd otherwise have to write again and again. Here Jay Hilyard explains how to use them.

Jay Hilyard

MSDN Magazine September 2006

Error Handling: Throwing Custom Exception Types from a Managed COM+ Server Application


Exception handling semantics in .NET are based on type, so you can create custom exceptions that have their own properties and methods. In .NET, exceptions are first-class citizens, and since they're the built-in error handling mechanism, all .NET-compliant languages must support exceptions. In addition, COM+ services are available to .NET code as Enterprise Services, so you can leverage exceptions in your Enterprise Services design.In this article the author describes custom exceptions, throwing exceptions across COM interop boundaries, and working with Enterprise Services.

Bob DeRemer

MSDN Magazine March 2004

'System OutOfMemory Exception' while using rdlc in Windows application

hi Everyone , I am Using Reporting Service (.rdlc) in my Windows application , i am getting Error System OutOfMemory Exception Like "an error occured during local report processing An Unexpected error occured in Report Processing Exception of type 'System OutOfMemory Exception'Was Thrown " what to do Please anyone help me ... Advance Thanks Anilmarnal

Sending 'ctrl-c' to the datagridview row of an external application using win32 api. Please help.

I'm just not able to send ctrl-c using my C# application to an external WinForm application. Here is my sequence of commands. I compared the messages using Spy++, and it matches except for my SendMessages are showing up as Send and Receive, vs. the same operation done on the WinForm is showing up as posted. My command sequence : NativeMethods.SendMessage(hwnd, WM_KEYDOWN, 0x00000011, 0x001D0001); NativeMethods.SendMessage(hwnd, WM_KEYDOWN, 0x00000043, 0x002E0001); NativeMethods.SendMessage(hwnd, WM_CHAR, 0x00000003, 0x002E0001); NativeMethods.SendMessage(hwnd, WM_KEYUP, 0x00000043, 0xC02E0001); NativeMethods.SendMessage(hwnd, WM_KEYUP, 0x00000011, 0xC01D0001); My Spy++ sequence : <00001> 0059043C S WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:299 yPos:52 [wParam:00000001 lParam:0034012B] <00002> 0059043C R WM_LBUTTONDOWN <00003> 0059043C S WM_LBUTTONUP fwKeys:MK_LBUTTON xPos:299 yPos:52 [wParam:00000001 lParam:0034012B] <00004> 0059043C R WM_LBUTTONUP <00005> 0059043C S WM_KEYDOWN nVirtKey:VK_CONTROL cRepeat:1 ScanCode:1D fExtended:0 fAltDown:0 fRepeat:0 fUp:0 [wParam:00000011 lParam:001D0001] <00006> 0059043C R WM_KEYDOWN <00007> 0059043C S WM_KEYDOWN nVirtKey:'C' cRepeat:1 ScanCode:2E fExtended:0 fAltDown:0 fRepeat:0 fUp:0 [wParam:00000043 lParam:002E0001] <00008> 0059043C R WM_KEYDOWN <00009> 00590

how can we show error in our application when exception occur in webs service

how can we show error in our application when exception occur in webs service

How to embed a win32 application in a WPF application

Hi, I was wondering if it would be possible to host a win32 application into a WPF application. I don't need to interact with it at all, I just want to host it in my WPF app. For example I want to be able to host a Notepad or Command Prompt window or any other win32 app. Is there a way for me to do this? Thank you, Cristian

System.BadImageFormatException:is not a valid Win32 application

We are facing problem while migrating a .Net 2.0 application 64 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.thanksNikhil

How to create a Custom Exception Handler using Micorosft Exception Handling Application Block?

Dear Friends,Can any one let me know "How to create a Custom Exception Handler using Microsoft Exception Handling Application Blocks"I will be having a set of Exceptions which will be getting maintained in an XML File along with the User Friendly Messages for a particular Exception. Whenever an Exception occurs in the projects first it need to check with the Exceptions present in the XML File and need to display the concerned user friendly message for that particular exception to the user..I am not able to get an idea on "How to start with the Microsoft Exception Handler Application Block" to achieve this". Please help me in this regard...Thanks and Regards,G.V.N.Sandeep.

an unhandled exception occurred in the silverlight application sharepoint 2010

An unhandled exception occurred on the page when Try to create the Announcement List in SP 2010 site which is upgraded from SP 2007,Any body have faced this issue?

Application Exception Rule Violation thrown on Delete

I basically have my first simple asp.net MVC 2.0 web application up and running except for deletes. I tried to do the first delete today, but it throws an exception with the text Rules Violation.  I'm not sure what is causing the error however.It shouldn't be the database (I don't think) because when I trace the database, I never see the delete call and after having it fail, I was able to sucessfully run:DELETE FROM [Work] WHERE work_id = 84 GOCurrently this is my method (yes its primitive, but I was just trying to get it working), its the db.SubmitChanges() line where the application exception gets thrown. [HttpPost] public ActionResult Delete(int id, FormCollection collection) { try { // TODO: Add delete logic here var result = db.Works.SingleOrDefault(w => w.work_id == id); if (result == null) return View("NotFound"); db.Works.DeleteOnSubmit(result); db.SubmitChanges(); return RedirectToAction("Index"); } catch { var result = db.Works.SingleOrDefault(w => w.work_id == id); return View(result); } } }This may be a Linq-to-Sql issue as this is really the first time I've us

Release mode application throws Break instruction exception - code 80000003 when running in WinDbg


Here is the initial output of my program after running it from WinDbg:

CommandLine: "C:\Documents and Settings\Administrator\My Documents\Work\QMI_Test_Tool\QMI_UT_Source\Release\QMI Validation Tool.exe"
Symbol search path is: SRV*c:\symbols*http://msdl.microsoft.com/download/symbols
Executable search path is: 
ModLoad: 00400000 0048f000  QMI Validation Tool.exe
ModLoad: 7c900000 7c9b2000  ntdll.dll
ModLoad: 79000000 7904a000  C:\WINDOWS\system32\mscoree.dll
ModLoad: 7c800000 7c8f6000  C:\WINDOWS\system32\KERNEL32.dll
ModLoad: 77dd0000 77e6b000  C:\WINDOWS\system32\advapi32.dll
ModLoad: 77e70000 77f03000  C:\WINDOWS\system32\RPCRT4.dll
ModLoad: 77fe0000 77ff1000  C:\WINDOWS\system32\Secur32.dll
ModLoad: 7c420000 7c4a7000  C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989\MSVCP80.dll
ModLoad: 78130000 781cb000  C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989\MSVCR80.dll
ModLoad: 77c10000 77c68000  C:\WINDOWS\system32\msvcrt.dll
ModLoad: 7c9c0000 7d1d7000  C:\WINDOWS\system32\SHELL32.dll
ModLoad: 77f10000 77f59000  C:\WINDOWS\system32\GDI32.dll
ModLoad: 7e410000 7e4a1000  C:\WINDOWS\system32\USER32.dll
ModLoad: 77f60000 77fd6000  C:\WINDOWS\system32\SHLWAPI.dll
ModLoad: 7c4c0000 7c53d000  C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989\m

Getting error when trying to start acroRd32.exe "Not a valid Win32 Application"


I am writing a .pdf file to a folder then attempting to silent print using acroRd32.exe. When I run the program I get the error 

"Not a valid win32 application"

The program is creating the pdf file correctly.


 string pathToExecutable = @"c:\Program Files\Adobe\Reader 9.0\AcroRd32.exe";

     RunExecutable(pathToExecutable, @"/t ""C:\WR014v2_.pdf""     ""//ussnadprt/USNPA039""");

 private static void RunExecutable(string executable, string arguments)
            ProcessStartInfo starter = new ProcessStartInfo(executable, arguments);
            starter.CreateNoWindow = true;
            starter.RedirectStandardOutput = true;
            starter.UseShellExecute = false;

            Process process = new Process();
            process.StartInfo = starter;

            StringBuilder buffer = new StringBuilder();

            using (StreamReader reader = process.StandardOutput)
                string line = reader.ReadLine();
                while (line != null)
                    line = reader.ReadLine();

Empty Catch in Global.asax to prevent exception from stopping a web application?



I'm using a static Timer in my Global.asax to run a method at regular intervals. When the method throws an exception, my application is stopped. I have used an empty catch to prevent exceptions from stopping the application something like below code. Is there a disadvantage to use such an approach?


 protected void Application_Start(object sender, EventArgs e)

 public class TimerStarter
            private static System.Threading.Timer threadingTimer;

            public static void StartTimer()
                if (null == threadingTimer)
                    threadingTimer = new System.Threading.Timer(new System.Threading.TimerCallback(CheckData),HttpContext.Current, 0, 50000);

            private static void CheckData(object sender)
                   // a method that reading xml file from another url              
                    // empty catch to prevent stopping the application




Exception when deploying .net remoting application over internet

Hi everyone,

I'm trying to make a .net application works in a computer outside my intranet, using a web service created with .Net remoting and
hosted in my intranet.

This application works well in any computer in the intranet, but not in the computer
that accesses the web service over the internet.

My .net remoting web service is configured in IIs and uses http channel.

I'm using interfaces and i'm implementing this interfaces each one
being a subclass of the MarshalByRefObject, like this:
    public interface IClassMain
      int GetSum(int a, int b);
      IClass1 Class1 { get; }

    public interface IClass1
      String GetFormattedName(string firstname, string lastname);

    internal class ClassMainImplementation : MarshalByRefObject, IClassMain
      private Class1Implementation m_class1Implementati

CLR Profiler is not working.Unhandled exception has occured in your application.


For me CLR Profiler is not working.

When i choose profile application and browser to the executable file.It show's up an message box

"waiting for application to start Common language runtime" .

the message box stays for long time and when i click on "Show Heap now" button even as above message box is displayed i get the following error

Unhandled exception has occured in your application. If you click Continue,the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.

Object reference not set to an instance of an object.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend