web apps and the GAC (cannot update assemblies)

S

Sam-I-Am

Hi There

I have several websites that use shared assemblies in the GAC. When I try
and update the GAC assemblies I get the following error:
"The process cannot access the file because it is being used by another
process"

It seems I have to restart IIS to update the GAC assemblies. This is not a
possibility. How else can I update the assemblies without a restart? How can
I determine what process/app is holding the reference to my assemblies?

Cheers,

Sam
 
R

Rick Strahl [MVP]

Sam,

That's one good argument to store as little as possible in the GAC and use
local directories instead, isn't it? <g> As soon as the GAC gets involved
all of ASP.Net's xCopy deployment falls apart and you're back to COM like
DLL hell issues requiring shutdown of applications.

If you really need to do this - consider using Copy Local for your GAC
assemblies in your app and de-reference them from the web.config (anything
but the pre-definied system assemblies in the GAC are not actually visible
to ASP.NET by default).

If you leave them in the GAC you need to live by the GAC rules, which means
shut down before update.

+++ Rick --

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
http://www.west-wind.com/wwThreads/
 
S

Sam-I-Am

Hi Rick

Thanks for the reply. We may start incrementing version number in the
assemblies if we do need to make updates and then update the web.config
files.

Could you elaborate on:
"> If you really need to do this - consider using Copy Local for your GAC
assemblies in your app and de-reference them from the web.config (anything
but the pre-definied system assemblies in the GAC are not actually visible
to ASP.NET by default)."

What do you mean by "using Copy Local for your GAC assemblies in your app
and de-reference them from the web.config"

Thanks again,

Sam
 
M

[MSFT]

Hi Sam,

Did you still have any concerns on this issue? If so, please feel free to
post here.

Luke
 
J

jasongb

I have a question...

We have to deploy many of our assemblies to the GAC so we can do CO
interop... More accurately, our COM components call our .NE
assemblies, so we're forced to use the GAC.

However, I want to be able to copy/paste deploy our websites. Can't
do something with web.config to FORCE the website to use the local cop
of the DLLs in the bin directory?

Any input appreciated


-
jasong
 
R

Rick Strahl [MVP]

Hi Jason

Not sure what you mean by that. If you copy the signed DLLs into your BIN
directory the app should be able to use them. ASP.NET applications don't
look at the GAC in the first place to find assemblies unless they are
registered

Yes you can pre-register GAC DLLs with the application in Web.Config like
this:

<compilation defaultLanguage="c#" debug="true">
<assemblies>
<add assembly="Mere Mortals Framework Interfaces,
Version=1.1.1118.20862, Culture=neutral, PublicKeyToken=2312fefb461dbb0e" />
<add assembly="Mere Mortals Framework Web Forms,
Version=1.1.1158.18447, Culture=neutral, PublicKeyToken=a16649d902b008d4"/>
</assemblies>
</compilation>

Note that you have the fully qualified name not just the assembly name.

Unless you actually are doing the above, any files in the BIN directory
should be found and used.

If you do have problems with this you might want to look carefully at your
dependencies of assemblies which may be what the problem is.

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
http://www.west-wind.com/wwThreads/
 

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,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top