Tutorial :C++ msvcp90d.dll Access violation exception


I was writing a c++/cli wrapper for a native c++ application, and when I finished writing code, it builds so well.

The native c++ is built to a static library (.lib) file, and I referenced it in my c++/cli wrapper, then I wrote a c# console application to test the wrapper. However, the debugger can be launched.If I commented the lines which referened the code in the wrapper, it worked well.

So when the debugger can not be launched I found that there's an unhandled exception appeared in the output window of visual studio: unhanded exception occured in msvcp90d.dll, access violation error writing location: 0ff......

Can anyone list some common senarios could cause this issue? Very appreciated with any answer.


I would step back and comment out the C++ code in your static lib and simply return from it. And check if the integration works.

Can you check for C++ Code Generation options? Try changing to multi-threaded runtime libs.


Can you check Runtime Library ? /MD should work. You need to recompile code with the /MD and /MDd flags, or change yours to /MT and /MTd.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »