473,911 Members | 5,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Assembly.GetCus tomAttributes 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.LoadFi le(MyAssemblyPa th);
object [] oa =
this._btAsembly .GetCustomAttri butes(typeof(Bi zTalkAssemblyAt tribute), false);
if (oa.Length > 0)
this._isBizTalk Assembly = true; // oa.Length = 0 here
*************** *************** *************** ***************
Code Sample 2:
object[] custAtt = this._btAsembly .GetCustomAttri butes(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 3196

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1794
by: AlexB | last post by:
A windows forms .NET application has various built in attributes like: <Assembly: AssemblyTitle("MyAssembly")> <Assembly: AssemblyDescription("Blahblah")> <Assembly: AssemblyCompany("XYZ")> But how can I reference these from within my windows forms application???
2
1679
by: serge calderara | last post by:
Dear all, In my assembly info file I have such kind of default information : <Assembly: AssemblyTitle("")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> Can I add any other type of information I want like as
1
1680
by: jez123456 | last post by:
Hi, I'm trying to add the product, title and version number to my main form with the following code. I've tried using this code in the public class FrmMain section but I get the error thisAsm' denotes a 'field' where a 'class' was expected. Also it will not compile 'this' with the error Keyword this is not available in the current context Any ideas? Thanks Assembly thisAsm = this.GetType().Assembly; string messageHeader =...
2
1261
by: Brian Henry | last post by:
Is there anyway to retrieve the GUID code of an assembly for use in the application as a unique identifier? thanks!
2
3403
by: Greg Bell | last post by:
Hi why does first bit work and 2nd doesn't: 1. Dim m_Trademark As SR.AssemblyTrademarkAttribute m_Trademark = m_AssInfo.GetCustomAttributes(GetType(SR.AssemblyTrademarkAttribute), False)(0) 2.
0
3022
by: qiang | last post by:
Hi everyone, Could you please take a look at an exception for ASP.NET application? My ASP.NET application is using Infragistics WebChart control. I encounter an exception below when deploying the application into a third-part host.
4
5221
by: Ron M. Newman | last post by:
Hi: How do I get the GUID string out of an assembly? (I have it loaded and referenced from an Assembly obect). -Ron
7
2375
by: Paul Hadfield | last post by:
Hi, I'm running into one problem with trying to call "Type.GetCustomAttributes(...)" on my reflected code. Basically - I can't trap my own custom attribute - I can only catch / identify system "Custom Attributes" by type. The output below identifies that I can catch the "DefaultMemberAttribute", but I can not catch my own "DirectoryVersionAttribute". Cany anyone throw any light on this as it is driving mad Thanks in Advance, - Paul....
1
8475
by: not_a_commie | last post by:
I've got some custom serialization code that relies heavily on Type.GetCustomAttributes, FieldInfo.GetCustomAttributes, and PropertyInfo.GetCustomAttributes. They are all incredibly slow. Those three account for 90% of the time in my code. Would it be wise to cache them in a dictionary? I doubt FieldInfo and PropertyInfo have well-implemented hash codes. And is the Property/ FieldInfo returned not dependent upon the owning instance? ...
0
9879
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10921
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8099
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7250
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5940
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6142
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3360
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.