Attempting to install DLL to GAC

Discussion in 'ASP .Net' started by Dylan Parry, Oct 6, 2009.

  1. Dylan Parry

    Dylan Parry Guest

    Hi,

    I’ve got a DLL file that is currently installed in the GAC. Occasionally
    I have to update the DLL for bug fixes etc, and what I normally do is
    overwrite the existing DLL in the GAC.

    This has been working fine for the last few years, but today I suddenly
    get an error:

    Assembly Cache Viewer - Install Failed
    Cannot access file 'Opus.dll' because it is being used by another process.

    This happens when I try to install the DLL by dragging it into the
    Assembly Viewer. I get a similar error when attempting to do it via the
    command line, but with the message "unknown error" rather than being
    told it’s used by another process.

    I’ve tried rebooting the server and turning off IIS, but neither of
    these have any effect.

    I have no idea why this is suddenly happening! I’m not aware of anything
    having changed on the server. All I know is that it’s seriously annoying
    and it’s stopping me from fixing a really annoying bug that I really
    need to fix asap :(

    Anyone got any clues as to what’s going on here?

    Cheers,

    --
    Dylan Parry
    http://electricfreedom.org | http://webpageworkshop.co.uk

    “If I had my life to live over again, I'd be a plumber†– Einstein
     
    Dylan Parry, Oct 6, 2009
    #1
    1. Advertising

  2. Dylan Parry wrote:
    > I've got a DLL file that is currently installed in the GAC.
    > Occasionally I have to update the DLL for bug fixes etc, and what I
    > normally do is overwrite the existing DLL in the GAC.
    >
    > This has been working fine for the last few years, but today I
    > suddenly get an error:
    >
    > Assembly Cache Viewer - Install Failed
    > Cannot access file 'Opus.dll' because it is being used by another
    > process.
    >
    > This happens when I try to install the DLL by dragging it into the
    > Assembly Viewer. I get a similar error when attempting to do it via
    > the command line, but with the message "unknown error" rather than
    > being
    > told it's used by another process.
    >
    > I've tried rebooting the server and turning off IIS, but neither of
    > these have any effect.
    >
    > I have no idea why this is suddenly happening! I'm not aware of
    > anything having changed on the server. All I know is that it's
    > seriously annoying and it's stopping me from fixing a really annoying
    > bug that I really
    > need to fix asap :(


    If you need it done asap rather than trying to find the root problem, have
    you tried replacing the file in safe mode (as in press F8 when booting)?

    Andrew
     
    Andrew Morton, Oct 6, 2009
    #2
    1. Advertising

  3. Dylan Parry

    Dylan Parry Guest

    Andrew Morton wrote:

    > If you need it done asap rather than trying to find the root problem, have
    > you tried replacing the file in safe mode (as in press F8 when booting)?


    Unfortunately not an option as the server is on the other side of the
    country in a data centre where I can’t get to it to press any buttons
    when it’s booting :(

    --
    Dylan Parry
    http://electricfreedom.org | http://webpageworkshop.co.uk

    “If I had my life to live over again, I'd be a plumber†– Einstein
     
    Dylan Parry, Oct 6, 2009
    #3
  4. Dylan Parry wrote:
    > Andrew Morton wrote:
    >
    >> If you need it done asap rather than trying to find the root
    >> problem, have you tried replacing the file in safe mode (as in press
    >> F8 when booting)?

    >
    > Unfortunately not an option as the server is on the other side of the
    > country in a data centre where I can't get to it to press any buttons
    > when it's booting :(


    In that case, you could use Process Explorer or Process Monitor to find what
    has a handle on Opus.dll and take "appropriate action".
    http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
    http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

    Andrew
     
    Andrew Morton, Oct 6, 2009
    #4
  5. Dylan Parry

    Dylan Parry Guest

    Andrew Morton wrote:

    > In that case, you could use Process Explorer or Process Monitor to find what
    > has a handle on Opus.dll and take "appropriate action".
    > http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
    > http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx


    Thanks, but didn’t work :( I found two open handles to the file, and
    closed them both, but still get the same error when trying to update the
    GAC.

    --
    Dylan Parry
    http://electricfreedom.org | http://webpageworkshop.co.uk

    “If I had my life to live over again, I'd be a plumber†– Einstein
     
    Dylan Parry, Oct 6, 2009
    #5
  6. Dylan Parry wrote:
    > Andrew Morton wrote:
    >
    >> In that case, you could use Process Explorer or Process Monitor to
    >> find what has a handle on Opus.dll and take "appropriate action".
    >> http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
    >> http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

    >
    > Thanks, but didn't work :( I found two open handles to the file, and
    > closed them both, but still get the same error when trying to update
    > the GAC.


    It might be that when you closed the handles, whatever had them open noticed
    and re-opened them after a short time. However...
    http://www.google.com/#hl=en&source=hp&q=windows delete file on reboot

    Although it is somewhat in the realm of it might break something on your
    server if something is that desperate to get a handle to the dll.

    Andrew
     
    Andrew Morton, Oct 6, 2009
    #6
  7. Dylan Parry <> wrote in
    news:hafcla$61h$-september.org:

    > Iƒ Tve got a DLL file that is currently installed in the GAC.
    > Occasionally I have to update the DLL for bug fixes etc, and what I
    > normally do is overwrite the existing DLL in the GAC.
    >
    > This has been working fine for the last few years, but today I
    > suddenly get an error:
    >
    > Assembly Cache Viewer - Install Failed
    > Cannot access file 'Opus.dll' because it is being used by another
    > process.
    >
    > This happens when I try to install the DLL by dragging it into the
    > Assembly Viewer. I get a similar error when attempting to do it via
    > the command line, but with the message "unknown error" rather than
    > being told itƒ Ts used by another process.
    >
    > Iƒ Tve tried rebooting the server and turning off IIS, but neither of
    > these have any effect.
    >
    > I have no idea why this is suddenly happening! Iƒ Tm not aware of
    > anything having changed on the server. All I know is that itƒ Ts
    > seriously annoying and itƒ Ts stopping me from fixing a really
    > annoying bug that I really need to fix asap :(
    >
    > Anyone got any clues as to whatƒ Ts going on here?


    Can you version the DLL so it can be installed side by side. When the
    next application hits, it should hit the newer version, unless you have
    registered a specific version, and you should then be able to delete the
    older version.

    This may not be an option for you, but if it is, it is a hell of a lot
    easier than making sure 100% of all processes that might be using the
    DLL are stopped.

    If you must bang through, try something like Process Explorer or other
    tools (install on server) and find out what is using the assembly and
    locking it.

    Peace and Grace,

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    Twitter: @gbworld
    Blog: http://gregorybeamer.spaces.live.com

    *******************************************
    | Think outside the box! |
    *******************************************
     
    Gregory A. Beamer, Oct 6, 2009
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alan Seunarayan

    GAC install

    Alan Seunarayan, Jan 16, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    594
    Mattias Sjögren
    Jan 16, 2004
  2. Bob
    Replies:
    4
    Views:
    16,173
  3. BillGatesFan

    Manually install DLL into GAC

    BillGatesFan, Dec 28, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    18,246
    BillGatesFan
    Dec 28, 2004
  4. Replies:
    1
    Views:
    131
    Jason LaRiviere
    Nov 28, 2006
  5. Alec Taylor
    Replies:
    0
    Views:
    223
    Alec Taylor
    Feb 3, 2012
Loading...

Share This Page