Wednesday, May 23, 2007

Deploy Failed, "A file load exception occurred while attempting to install the assembly into the Global Assembly Cache."

Occassionally when deploying a BizTalk resource from Visual Studio you will receive the following error message:


Error 16 Failed to add resource(s). Change requests failed for some resources. BizTalkAssemblyResourceManager failed to complete end type change request. Unable to install the "C:\Documents and Settings\foc18bs\Local Settings\Temp\BT\PID1188\BizTalkAssembly\c94a039fff06502b4de07ec61b983b9c\EPS.Schemas.dll" assembly into the Global Assembly Cache.
Exception: A file load exception occurred while attempting to install the assembly into the Global Assembly Cache. This error may occur if the assembly is delay signed, or if assembly was renamed after creating/signing.


I encountered this problem today and after a bit of exploring found out that it was happening because the assembly in question was still in use by a process. Sometimes it can get difficult to track down what process is using the file so I consulted the free Microsoft utility, Process Explorer and found out that some mmc process had a handle on it.

I killed all the non devenv processes that had a handle on the dll. I was then able to successfully redeploy.

Edit: You may have to kill some of the handles that devenv.exe has as well. Spefically those that have a handle on the instance of the dll in the GAC directory.

3 comments:

Anonymous said...

Rather excellent idea

Anonymous said...

Good dispatch and this fill someone in on helped me alot in my college assignement. Thank you seeking your information.

Anonymous said...

nice post. thanks.