473,624 Members | 2,135 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1717
..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******** ******@TK2MSFTN GP09.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
3038
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 Unix/Windows. Why use Python? End user flexibility. So far it seems that (on Windows): (1) memory increases when you import <module>. Expected behaviour. (2) memory does not release when you del <module>. Why not? Is Python
31
2711
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 public and I'm wanting to release a Python program I wrote for review (and critique) and testing on other platforms, but also I would like to explore the different software licenses that are available (there seems to be many). Since the specification...
4
4120
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 symbols I am going to use from the wrapper library. The wrapper library has the code written that uses the native classes, and wraps them to present an equivalent of their interface for .NET.
18
3705
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 this question), other than these two: DAO.Database DAO.Recordset ? To rephrase: Can you demonstrate any situation where failure to
1
2047
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 native dll method where one or more of the parameters in the native routine is an array or pointer to block of contiguous memory. So, for example, the method as exported from the native Dll is declared as: extern "C" unsigned int __stdcall...
9
2067
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
1361
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 interpreter lock, like Python's native blocking functions do, like I/O funcs, and time.sleep() func.
5
7253
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# application. My question is: Does the performance of the unmanaged pure native C++ class described above is the same if it was a in a pure unmanaged native C++ DLL component?
3
1481
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 free() function call on that and make sure that they point to null?
0
8234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8172
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8620
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7158
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6110
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5563
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.