EndPoints Assembly SmartObjects and AppDomains

  • 16 February 2021
  • 0 replies
  • 11 views

Userlevel 5
Badge +20
 

EndPoints Assembly SmartObjects and AppDomains

KB001567

PRODUCT
K2 blackpearl 4.6.7 to 4.7
BASED ON
K2 blackpearl 4.6.7
LEGACY/ARCHIVED CONTENT
This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.

 

Behavior change: new BaseDirectory and separate AppDomains per Endpoint Instance

Each Service Instance runs within its own AppDomain. This is to allow for replacing assemblies without having to reboot the HostServer.

In K2 blackpearl 4.6.7, the AppDomain BaseDirectory has changed from:

C:Program Files (x86)K2 blackpearlHost ServerBin

To: C:Program Files (x86)K2 blackpearl

Code referencing the BaseDirectory in SmartObjects built on K2 blackpearl 4.6.6 will return an error after upgrading to K2 blackpearl 4.6.7. References to assemblies using the AppDomain.CurrentDomain.BaseDirectory value should rather be using the Assembly.Location property (see http://msdn.microsoft.com/en-us/library/system.reflection.assembly.location(v=vs.110).aspx)

 

 

Background

An Endpoint’s ServiceInstance’s assembly used to be loaded into the K2HostServer’s AppDomain which is located in the C:Program Files (x86)K2 blackpearlHost ServerBin directory and was then able to reference dependent assemblies in the C:Program Files (x86)K2 blackpearlServiceBroker directory as the assembly physically resided in that directory. And it could reference assemblies in C:Program Files (x86)K2 blackpearlHost ServerBin due to the AppDomain being in that directory. Since the behavioral change making it run in its own AppDomain, the only way to reference dependent assemblies in both those locations was to make the BaseDirectory C:Program Files (x86)K2 blackpearl and change the PrivateBinPath to the C:Program Files (x86)K2 blackpearlServiceBroker and C:Program Files (x86)K2 blackpearlHost ServerBin directories as these paths are relative to the BaseDirectory.

 


0 replies

Be the first to reply!

Reply