473,378 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

System.Reflection.Assembly.GetExecutingAssembly

Hi why does first bit work and 2nd doesn't:

1.
Dim m_Trademark As SR.AssemblyTrademarkAttribute

m_Trademark =
m_AssInfo.GetCustomAttributes(GetType(SR.AssemblyT rademarkAttribute),
False)(0)

2.

Dim m_Version As SR.AssemblyVersionAttribute

Try

m_Version =
m_AssInfo.GetCustomAttributes(GetType(SR.AssemblyV ersionAttribute),
False)(0)

Return m_Version.Version.ToString

Catch Ex As Exception

MsgBox(Ex.ToString)

End Try

The error says that IndexOutOfRangeException

but the AssemblyInfo.vb has:

<Assembly: AssemblyTitle("Test")>

<Assembly: AssemblyDescription("Test System")>

<Assembly: AssemblyCompany("Bell")>

<Assembly: AssemblyProduct("DotNetProject")>

<Assembly: AssemblyCopyright("Copyright © 2005 . All rights reserved.")>

<Assembly: CLSCompliant(True)>

<Assembly: AssemblyVersion("1.5.*")>

Greg
Nov 21 '05 #1
2 3370
Greg,
Hi why does first bit work and 2nd doesn't:


AssemblyVersionAttribute is special. The attribute is removed since
the version becomes part of the assembly name. You get it with
m_AssInfo.GetName().Version.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 21 '05 #2
Thanks Mattias,
"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Greg,
Hi why does first bit work and 2nd doesn't:


AssemblyVersionAttribute is special. The attribute is removed since
the version becomes part of the assembly name. You get it with
m_AssInfo.GetName().Version.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 21 '05 #3

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

Similar topics

4
by: Jesse Elve | last post by:
I am using an XmlValidatingReader which uses an XSD for xml validation. The code has been performing reliably for months. Yesterday it failed for the first time with the following exception: ...
3
by: Bisbal | last post by:
Hi, I'd like to know if it is possible to create a form type from a string. My case: I have a DataTable with forms names (i.e frm_001_UserInfo.cs), and I'd like to create an instance of that...
6
by: JV | last post by:
Is there a way to determine that an assembly is running under an ASP.NET web application as opposed to a Windows application? For example, in an ASP.NET application if I call...
1
by: Brian | last post by:
I've looked through the previous posts on this one and have verified permissions and location of my Dlls, but I am still getting an exception when I try to Load an assembly. The directory where...
0
by: MWells | last post by:
I have a simple VS.NET solution with Project "A" as a web app and Project "B" as a class library. "B" does some HTML rendering, and uses reflection to locate and load the necessary rendering...
28
by: Nina | last post by:
I need to generate unique id for my application. Use system time to create id, which is the best fit, but I don't know how to do it. Please help. Thanks in advance for any input.
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
1
by: Patrick | last post by:
Has been trying to get an ASP.NET DLL's modification date/time for the "release date/time" to be displayed on the page's footer Using: System.Reflection.Assembly...
10
by: Ron | last post by:
I have a situation where I have an object name as a string, and a method as a string. I need to construct a click handler with those two bits of information. This is what I came up with so far......
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.