Hi to you all,
I'm using the following code (Code Sample 1) to determine whether an
assembly is
a BizTalk assembly or not. When I run the code in different machines I fount
out
that it does not always has the same results. I also tried the second code
sample (Code Sample 2)but still, I only got the attributes that are not
BizTalkAssembly attributes. My guess is that this has to do with permissions,
but I'm not quite sure in what way.
************************************************************
Code Sample 1:
this._btAsembly = Assembly.LoadFile(MyAssemblyPath);
object [] oa =
this._btAsembly.GetCustomAttributes(typeof(BizTalkAssemblyAttribute), false);
if (oa.Length > 0)
this._isBizTalkAssembly = true; // oa.Length = 0 here
************************************************************
Code Sample 2:
object[] custAtt = this._btAsembly.GetCustomAttributes(false);
// custAtt.Length = 14 on my machine
// custAtt.Length = 13 on my QA machine (The only attribute which is
// BizTalkAssembly type is missing from the list).
************************************************************
Of course I'm loading the exact same assembly in both machines.
Any ideas anyone?
Thanks,
Elad
|