Access Violation When Launching Application Through Visual Studio
When I run my app from command line from Visual Studio, one command always fails with below error:
The program '[7316] MyProgram.vshost.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.
When I debug the code, it happens after the last line of execution. This means that the application performs the function correctly, but then crashes. When I build the project and run the exe file on the command line, I get no error and it works fine.
The project uses a third party dll which in turn AFAIK calls a C or C ++ dll for example. something not coded in .Net.
My questions are: can I ignore this error as the application works fine when building? If not, what could be the potential problem and how can I resolve it?
source to share
Can I ignore this error as the application works fine when building?
I wouldn't ignore this problem. If your application is not running at the time of shutdown, there might be something wrong with it destroying objects and returning Windows handles (most likely the latter). This could eventually lead to a production script.
If not, what could be the potential problem and how can I resolve it?
As stated, I think releasing the pens is the problem. If you are using a third party DLL written in C ++, there might be a problem. Try to set up some logging and see what the exception stack trace is. This can give you an idea of the causes of the problem. It might even be a problem that you can report to the DLL vendor.
source to share