DLL Lock Issue



Hi everyone

Well here is my problem

I hope you can help me

I have a web application. My web application is 4 different dlls

1. The First DLL is a Class library with shared routines and staff like that
(VB Project)

2. The Second DLL is an ASP .Net application and it's the shell let's say.
It has some basics screens and from there you can build all the layout of
the application

3. The Third DLL is a DLL with web services

4. The Last DLL is an ASP .Net application also. Is a different application
and is loaded from the 2nd DLL. This Application uses an other database and
has its own components created.

The Second, Third and Forth DLL have a reference to the First DLL. (Project

The Physical Path of the Application Looks Like This

Web Application (Directory)

|-\Bin (First & Second DLL)

| Web.Config File


|-\Services (Directory)

| |-\bin(Third Dll)

| | Web.Config File for Loading the Assembly


|-\Project (Directory)

|-\bin(Forth DLL)

| Web.Config file for loading the Assembly

Now I hope you have understand the structure.

The Problem is that now we are developing the Forth DLL and some times when
we make some changes only in the DLL we can not copy the new DLL on the web
servers because it's been used by an other process (Windows Message).

When we insert the DLL on the Web Application Bin Directory and delete the
Project Web.Config File that loads the assembly we can do what ever we want.
Delete the DLL , Copy a new DLL in the Directory etc.

Can any one help me ??

The structure we are using now is the correct

The Web.Config Of the Web Application looks like this one


<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

<probing privatePath="Project/bin;bin;services/bin; " />




<compilation defaultLanguage="vb" debug="true">




And the Web.Config Inside the Project Directory Looks like this


<compilation defaultLanguage="vb" debug="true">


<add assembly="DLI" />




What can I do to fix the problem??

We need to upload new DLL fro the Project often. It's not a good idea to
upload the entire "Web Application" and create a new version. Some times we
need to do small, and also the cost of uploading is enormous.

And also I need the production environment to be exactly the same as the
development environment. It's not a solution to build the Project and then
manually copy the DLL from the Project\Bin Folder to the Web Application\Bin

Thank you all


Sorry i have make an spelling error
The Web.Config Inside the Project Directory Looks like this


<compilation defaultLanguage="vb" debug="true">


<add assembly="Project" />




The Assembly has the corrent name
I have just write it wrongly were
The assembly is loaded correctly.

Thank you ;)

Scott Allen

The shadow copy feature of ASP.NET is only enabled for the bin
subdirectory. Shadow copy is a feature that copies the dll to a
temporary location before loading into an appdomain, thus avoiding a
lock on the original dll.

Nick Malik

what is the error, Dimitris?

When you delete web.config, your web application is notified. It will
unload all dlls and wait for a calling app to request a resource before
loading them up again. This allows you to update your dll.

This is pretty normal behavior.

If you want to be able to update a DLL "on the fly" then you will want to
provide the name of the DLL in the web.config and use reflection to load it.
THat way, you can install a new DLL WITH A NEW NAME into the web directory,
and then just replace the web.config file with an updated file, which has
the effect of unloading the old dlls. When your app wants the resources, it
checks the web.config for the name of the dll to load. Since a new name
will be provided, you can load the new one.

Hope this helps,
--- Nick

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