Yossi Dahan [BizTalk]

Google
 

Sunday, December 17, 2006

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:


Failure adding assembly to the cache: Cannot create a file when
that file already exists

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.

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:

Post a Comment

<< Home