次の方法で共有


Atomic scope for Non Serializable code

Many a times we use Atomic scope inside an orchestration to call non serializable code. for eg. Entreprise library logging component ver 3.0 is not serializable as the bts compiler suggests .

error X2141: a non-serializable object type 'SomeAssembly.SomeComponent yourComponent' can only be declared within an atomic scope or service .

But i feel the better way is to .

Write a simple >Net class library eg. Biztalkhelper.cs and create a static method which does the logging / any other purpose. Build the dll.

Referece the class library Proj from Bts Project, call the static method from the  Orchestration without declaring any scope / transaction etc.

And of course it also helps in avoiding the calling Orchestrations to be transactional... atleast we found this useful in my case.

Comments