Using a native C++ dll in a C# ASP.NET Website -
in order use native c++ dll in c# asp.net website have done following based upon numerous researches:
(1) created c++ native dll: cmatrix.dll containing constructors
cmatrix(); cmatrix(unsigned int m, unsigned int n);
- it has been tested.
(2) created c++/cli wrapper dll: managedcmatrix.dll. example contains following class:
public ref class managedcmatrix { public: managedcmatrix(); managedcmatrix(const unsigned int m, const unsigned int n); ~managedcmatrix(); ... private: cmatrix * m_mat; }; first constructor example: managedcmatrix:managedcmatrix() { m_mat = new cmatrix(); } again have tested dll referencing c# project - seems work
(3) have added managedcmatrix reference c# asp.net website making sure , cmatrix.dll in bin directory of website. make sure path environment variable includes bin directory. when use managed wrapper class in:
managedcmatrix = new managedcmatrix(m,n)
an exception thrown.
this exception thrown on sites' webserver. not thrown on visual studio 2010 development webserver - works expected.
what going on?
Comments
Post a Comment