Error when GAC-ing assembly
This was a bit unexpected (but very easy to figure out)-
I've tried to replace an assembly in the GAC the other day by dragging the dll file into the Windows\Assembly folder when I got the following error:
Strange - I thought - sure the file exists, I'm trying to replace an existing one, as I (and every BizTalk developer, I'm sure) do so many times without a problem.
After playing around for a second or two the answer was found - we had a command line window in that assembly's GAC folder. closing that window (or moving to another folder) allowed me to succesfully add the assembly to the GAC.
I don't really know, but I suspect GACUtil tries to recreate the folder when you GAC an assembly and having the CMD window in that folder did not allow it to be removed (and re-created)
And what was I doing there in the first place? Thats very simple - thats my way of adding pdb's to the GAC to allow debugging remotely...
I've tried to replace an assembly in the GAC the other day by dragging the dll file into the Windows\Assembly folder when I got the following error:
Right, I've said, must be the explorer view, so I quickly opened VS Command Line and used GacUtil /i only to receive the same error. adding /f did not help.Failure adding assembly to the cache: Cannot create a file when
that file already exists
Strange - I thought - sure the file exists, I'm trying to replace an existing one, as I (and every BizTalk developer, I'm sure) do so many times without a problem.
After playing around for a second or two the answer was found - we had a command line window in that assembly's GAC folder. closing that window (or moving to another folder) allowed me to succesfully add the assembly to the GAC.
I don't really know, but I suspect GACUtil tries to recreate the folder when you GAC an assembly and having the CMD window in that folder did not allow it to be removed (and re-created)
And what was I doing there in the first place? Thats very simple - thats my way of adding pdb's to the GAC to allow debugging remotely...
8 Comments:
That is exactly the solution for the problem I was :) having.
By
Anonymous, at 21/07/2008, 16:13
thanks. this happened to me as well, and this tip helped!
By
bubuli, at 18/08/2008, 21:18
Thank you, came across this problem the other day and this fixed it.
By
Charles Lee, at 04/12/2008, 15:56
Thanks, this helped me too.
By
Anonymous, at 02/01/2009, 06:57
Cheers Yossi, this one had me scratching my head, but I have a command line window open in that folder..... Doh!
By
Nick Heppleston, at 14/05/2009, 13:33
Thanks, this is exactly what happened to me.
By
Anonymous, at 08/01/2010, 11:19
I close all programs ( mainly VS) which this assembly used.
By
Anonymous, at 15/07/2010, 13:13
This had me stuck as well - thanks for helping me figure out it was my command prompt :)
By
Ryan McCauley, at 13/10/2011, 16:49
Post a comment
<< Home