简体   繁体   中英

VS2012 C# - vshost32 has stopped working

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?

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

vshost32.exe与窗口形式的设计器模拟任务相关,因此请尝试创建一个新项目,然后从旧项目中提取您的类。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM