By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,083 Members | 2,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,083 IT Pros & Developers. It's quick & easy.

VS.NET 2003 build causes DllNotFoundException at CoCreateInstance

P: n/a
I have a managed C++ class that exposes a COM object to ASP.NET. This
COM object creates several other COM objects internally. A VS.NET
2002 build of the dll works fine on .NET 1.0 and 1.1. A VS.NET 2003
build, however, fails when the COM object calls CoCreateInstance.
This happens only if the .NET type is used by two web applications on
the same server. The first web app to create the .NET type always
succeeds and the second web app always fails. CoCreateInstance throws
DllNotFoundExceptioin(0x80131524). All COM objects are threading
model 'both' so 'ASPCOMPAT' is not set to 'true' in the ASP.NET pages.

As a test, I've written a test that does nothing but expose 1 property
and the COM object calls CoCreateInstance in the property getter. The
failure occurs in this simple test. I've tried puting the dll in the
GAC and C:\winnt\system32, but the error still occurs.

I'd prefer to use a VS.NET 2003 build to take advantage of the fix to
the AppDomainUnloaded exception in the VS.NET 2003 VC++ compiler
(http://support.microsoft.com/?kbid=309694).

Any advice would be much appreciated.
Nov 16 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.