المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Wrapped COM call works during Test, otherwise fails



C# Programming
12-02-2009, 02:20 PM
I have an unusual situation.

A call from C# to C++ using static extern references to an un-mananged dll works perfectly during execution of TestClass/TestMethod unit testing within Visual Studio 2008. However, during debug (not during Testing) and normal execution, we receive an exception from the underlying COM object for which the C++ dll is a wrapper. And, right on queue, the third party COM object gives no detail why it failed.

I cannot much paste code because of proprietary reasons, however, here is the extern from C# which works fine under the context of unit testing (TestClass/TestMethod) in VS 2008.


[DllImport("BTDataAccess.dll")]
static extern uint BTReadBu( [In, MarshalAs(UnmanagedType.BStr)] string filePath);


Few notes, we do have the c++/unmanaged copied to both the C# test project and console app. Additionally, the list of c# project refernces between test and console projects have been reviewed.

Any ideas regardless of how far out they are would be appreciated.