471,570 Members | 906 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,570 software developers and data experts.

Assembly.GetCustomAttributes Method

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(BizTalk AssemblyAttribute), 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
Dec 1 '05 #1
0 3112

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by AlexB | last post: by
2 posts views Thread by serge calderara | last post: by
1 post views Thread by jez123456 | last post: by
2 posts views Thread by Brian Henry | last post: by
4 posts views Thread by Ron M. Newman | last post: by
1 post views Thread by not_a_commie | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.