[Migrated content. Thread originally posted on 14 February 2012]
I'm attempting to create web services that call unmanaged COBOL code. I thought everything was all well and fine until I started load testing and receiving accessViolationException exceptions. I did find the following article which was a great help www.philadelphia.edu.jo/.../PInvoke_tcm21-6374.pdf, and as an alternative to aspcompat="true" devlicio.us/.../calling-an-sta-com-object-from-a-wcf-operation.aspx, but I'm still having some issues.So I compiled my unmanaged dll using the REENTRANT(2) directive and that seemed to work okay, but memory is never released. Then I tried creating the COM server interface using the toolkit, but when I get multiple threads running against the COM component the accessViolationException is being thrown again. I tried setting the REENTRANT directive in the project directives, Build directives, and I tried specifying them during the Service Interface wizard, but when I deploy the COM I still get the same exception.
My other issue is disposing of the unmanaged resources. To release the resources do I just need to execute a stop run? Will this release resources from all of the modules that were called through the entire process?
If you need more information let me know.
Thank you,
Tony