Mixed-Mode Assembly CRT Initialization Question

R

Russ Barrett

Hello, I'm new to ASP.Net and I'm trying to interface an ASP.Net (C#)
application to functionality resident in a C++ static lib.
From posts I've seen around I understand this requires creation of a
'mixed-mode' assembly. Since a dll of this type provides no normal entry
point for C Runtime (CRT) library initialization, I understand that the dll
must provide its own exported functions to do this. Thus, from samples I've
seen on the web, I've created an assembly dll that includes these functions
and also binds to the legacy static C++ lib.
Unfortunately, using even the simplest of classes within the dll results in
a failure to load of the mixed-mode assembly with:

Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.
Parser Error Message: File or assembly name xxxxxxxxxxx, or one of its
dependencies, was not found.
Source Error:Line 196: <add assembly="System.EnterpriseServices,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 197: <add assembly="System.Web.Mobile, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 198: <add assembly="*"/>
Line 199: </assemblies>
Line 200: </compilation>

I believe the problem may be due to the absence of initialized CRT when the
C++ library statics are being initialized (during the assembly probe). IOW,
I need to call the CRT initialization exports early enough such that the
statics can be successfully initialized.

My question is:
Where can I call the mixed-mode assembly CRT initialization functions from
within an ASP.Net (C#) application, such that the statics within the C++
library (that use CRT) can be initialized?

Any help greatly appreciated,
Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top