VS2012 C# - vshost32 has stopped working

1.6k views Asked by At

I have a windows form application which is basically a PDF viewer. I used the Adobe PDF Viewer COM component for this project.

The program works but I'm having an issue when I click the close button on the top right of the form after I open a pdf file. When I click the close button, VS does not exit the 'run'-mode and I have to manually click the 'stop' button on VS. And when I press the stop button, a window pops saying "vshost32 has stopped working".

However, this does not happen when I run the application and close it without opening a pdf file.

Any idea why this happens?

2

There are 2 answers

0
Abhishek Shetty On

You may have manually release the COM object by using Marshal. See this link: http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshal.releasecomobject.aspx

1
Ramy Yousef On

The vshost32.exe is related to designer-simulation tasks in window forms, so try creating a new project then improt your classes from the old one.