DLL Lock Issue

P

Programmer

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
Reference)





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





<runtime>

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

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

</assemblyBinding>

</runtime>

<system.web>

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

<assemblies></assemblies>

</compilation>

</system.web>



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

<system.web>

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

<assemblies>

<add assembly="DLI" />

</assemblies>

</compilation>

<system.web>



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
Folder



Thank you all
 
P

Programmer

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

<system.web>

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

<assemblies>

<add assembly="Project" />

</assemblies>

</compilation>

<system.web>

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

Thank you ;)
Dimitris
 
S

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.
 
N

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top