BizTalk Server Framework - BizTalkAssembly Class reference issue

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Framework > October 2005 > BizTalkAssembly Class reference issue





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author BizTalkAssembly Class reference issue
Elad

2005-09-28, 5:59 pm

Hello!
I'm using the method Deploy of the Class BizTalkAssembly to deploy a BizTalk
Assembly. After deploying the assembly I'm trying to Move the assembly file
to a new location and encountring an access violation error:
"The process cannot access the file xxx because it is being used by another
process."
Only when I close my application I can move/delete the assembly file.

Does anyone has any idea how to free the reference to the assembly so I will
be able to delete/move it from within my application after deploying it?

This is the code I'm running:
BizTalkAssembly btAssembly = new BizTalkAssembly();
btAssembly.Load(sAssemblyPath);
btAssembly.Deploy(true, sMyServer, sMyDb, sAssemblyPath, string.Empty,
sMyAppLog);
btAssembly.Dispose();
btAssembly = null;

File.Move (sAssemblyPath, sNewPath); // Error in this line...

Thanks
Elad

Marvin Smit

2005-10-24, 10:32 am

Hi,

the problem is that an assembly does not get unloaded untill the app
domain is torn down. If you still want to keep this in 1 application
that does not shut down between the deploy and the movefile, you'll
have to create your own appdomain and tun the deploy in there. Then
release that app domain (releasing the assembly as well).

Hope this helps,

Marvin Smit.

On Wed, 28 Sep 2005 06:26:19 -0700, "Elad"
<Elad@discussions.microsoft.com> wrote:

>Hello!
>I'm using the method Deploy of the Class BizTalkAssembly to deploy a BizTalk
>Assembly. After deploying the assembly I'm trying to Move the assembly file
>to a new location and encountring an access violation error:
>"The process cannot access the file xxx because it is being used by another
>process."
>Only when I close my application I can move/delete the assembly file.
>
>Does anyone has any idea how to free the reference to the assembly so I will
>be able to delete/move it from within my application after deploying it?
>
>This is the code I'm running:
>BizTalkAssembly btAssembly = new BizTalkAssembly();
>btAssembly.Load(sAssemblyPath);
>btAssembly.Deploy(true, sMyServer, sMyDb, sAssemblyPath, string.Empty,
>sMyAppLog);
>btAssembly.Dispose();
>btAssembly = null;
>
>File.Move (sAssemblyPath, sNewPath); // Error in this line...
>
>Thanks
>Elad


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com