PC Review


Reply
Thread Tools Rate Thread

Assembly.GetCustomAttributes Method

 
 
=?Utf-8?B?RWxhZA==?=
Guest
Posts: n/a
 
      1st Dec 2005
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run assembly method in another app domain nick_nw Microsoft Dot NET Framework 1 7th Apr 2006 08:32 PM
Loading assembly Method on Runtime =?Utf-8?B?U3VkaGVl?= Microsoft Dot NET 0 22nd Mar 2006 02:00 PM
Rename all method names in an assembly Caroline Microsoft C# .NET 3 22nd Jan 2006 07:32 AM
How would I get a method name from the calling assembly? kevingabbert@gmail.com Microsoft Dot NET Framework 1 30th Mar 2005 10:41 PM
Assembly method dependency walker =?Utf-8?B?bWlrZUBuZXdzZ3JvdXBzLm5vc3BhbQ==?= Microsoft Dot NET 0 7th Apr 2004 12:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:12 PM.