473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Releasing a native DLL

How can we get ASP.NET/CLR to release a native DLL when using P/Invoke. We
are building a web application that uses a native DLL heavily. It's
unlikely that we will ever have a Managed DLL because of the 3rd party
static library (.LIB) file that we're using. The problem is that when one
of the pages that uses the native DLL is requested, the native DLL becomes
locked. We need the CLR to release the native DLL because when we go live,
we won't have control of the Web Server so we can't run "iisreset." I'm
guessing P/Invoke builds a proxy between the Managed DLL and the native DLL
an the proxy locks the DLL until it's garbage collected. Since the GC is
non-deterministic it's difficult to know when the native DLL will be
released. Does anyone know of a solution to this problem?
Nov 18 '05 #1
1 1708
..net has no support for unloading a dll, only an AppDomain.

if you need the ability to unload a dll, you need to load it in its own
appdomain which you can unload at will. you will need to use a remoteing
proxy that calls the P/Invoke to talk across domains, so watch perfomance.
see "Programing with Application Domains".
-- bruce (sqlwork.com)

"Mike King" <em*****@excite.com> wrote in message
news:#w**************@TK2MSFTNGP09.phx.gbl...
How can we get ASP.NET/CLR to release a native DLL when using P/Invoke. We are building a web application that uses a native DLL heavily. It's
unlikely that we will ever have a Managed DLL because of the 3rd party
static library (.LIB) file that we're using. The problem is that when one
of the pages that uses the native DLL is requested, the native DLL becomes
locked. We need the CLR to release the native DLL because when we go live, we won't have control of the Web Server so we can't run "iisreset." I'm
guessing P/Invoke builds a proxy between the Managed DLL and the native DLL an the proxy locks the DLL until it's garbage collected. Since the GC is
non-deterministic it's difficult to know when the native DLL will be
released. Does anyone know of a solution to this problem?

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: lebo | last post by:
Hi I'm trying to understand how Python handles memory usage and dynamic object loading and unloading. Problem to solve? Build a very low memory footprint (non-GUI) Python application for...
31
by: poisondart | last post by:
Hi, I'm not sure if this is the right group to post this. If not, then I would appreciate if somebody could point me to the correct group. This is my first time releasing software to the...
4
by: David Kantowitz | last post by:
I am trying to wrap a native-C++ DLL in managed C++, to use in a .NET project. The native code is compiled into a DLL, and I have created a .def file that exports the mangled names of the...
18
by: lylefair | last post by:
Can you post code, or a reference to a md? or ad? file on a website, where object variables are not released when they go out of scope and cause a problem, (but causing a problem is extraneous to...
1
by: dln | last post by:
Hey all. I'm a bit new to the language and I'm trying to figure out how to have my c# application interact with native code that is exported via a dll. I've run into a problem interfacing with a...
9
by: Herby | last post by:
Is possible to have a managed method within a Native(un-managed) class within a \clr project? E.g. class myClass { public: #pragma managed void myMethod(void);
2
by: Bram Stolk | last post by:
Hello, I've implemented, in C, a function that does a lot of I/O, and thus can block for a long time. If I execute this function in my Python script, it does not relinquish the global...
5
by: =?Utf-8?B?U2hhcm9u?= | last post by:
I have a class that is writen in unmanaged pure native C++. This class files (h and cpp) are inserted to a managed C++ (VC++ 2005, C++/CLI) DLL compoenet. This DLL compoenet is used in a C#...
3
by: ssylee | last post by:
For example, I have a BITMAPINFO* and a BYTE* object to release the resources. Would the most bulletproof way of doing so involve checking to see if they are null, then if they are not, invoke a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.