PC Review


Reply
Thread Tools Rate Thread

How can I get Assembly Name?

 
 
Tom
Guest
Posts: n/a
 
      25th Oct 2004
Application.ProductName returns the root namespace. How do I get the
assembly name as displayed on the project properties dialog?

Tom
 
Reply With Quote
 
 
 
 
Imran Koradia
Guest
Posts: n/a
 
      25th Oct 2004
System.Reflection.Assembly.GetExecutingAssembly.GetName.Name()

hope that helps..
Imran.

"Tom" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Application.ProductName returns the root namespace. How do I get the
> assembly name as displayed on the project properties dialog?
>
> Tom



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      25th Oct 2004
"Tom" <(E-Mail Removed)> schrieb:
> Application.ProductName returns the root namespace. How do I get the
> assembly name as displayed on the project properties dialog?


\\\
Imports System.Reflection
..
..
..
MsgBox([Assembly].GetEntryAssembly().GetName().Name)
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


 
Reply With Quote
 
Tom
Guest
Posts: n/a
 
      25th Oct 2004
Yes that helps, but dang that's long (62 characters). I was most of the
way there. You know you're on the right track if it takes more code than
VB6.


Imran Koradia wrote:

> System.Reflection.Assembly.GetExecutingAssembly.GetName.Name()
>
> hope that helps..
> Imran.
>
> "Tom" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>
>>Application.ProductName returns the root namespace. How do I get the
>>assembly name as displayed on the project properties dialog?
>>
>>Tom

>
>
>

 
Reply With Quote
 
Imran Koradia
Guest
Posts: n/a
 
      25th Oct 2004
"Tom" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Yes that helps, but dang that's long (62 characters). I was most of the
> way there. You know you're on the right track if it takes more code than
> VB6.


lol...

You can obviously reduce the verbosity by typing an Imports statement:

Imports System.Reflection
[Assembly].GetExecutingAssembly().GetName().Name


so you see - it isn't that bad after all

Imran.


 
Reply With Quote
 
Jay B. Harlow [MVP - Outlook]
Guest
Posts: n/a
 
      25th Oct 2004
Tom,
Herfried & Imran answered your question.

I just wanted to point out that Application.ProductName does not return the
root namespace per se.

It actually returns the value of the AssemblyProductAttribute found in the
AssemblyInfo.vb file of your project. If you leave this attribute its
default value of blank then you do indeed get the root namespace. However if
you change the attribute's value then you will get the new value.

I normally change the AssemblyProductAttribute to a displayable value & use
Application.ProductName as my message box titles.

Note Application.ProductVersion comes from the
AssemblyInformationalVersionAttribute if you add it to your AssemblyInfo.vb
file, if you do not add AssemblyInformationalVersion, the
Application.ProductVersion comes from the AssemblyVersionAttribute:

For example, if my root namespace is "TheGreatAndWonderfulApp", I might set
my AssemblyInfo.vb file as:

....
<Assembly: AssemblyProduct("The Great & Wonderful Application")>
....
<Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyInformationalVersion("1.0")> ' Product Version

Hope this helps
Jay

"Tom" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Application.ProductName returns the root namespace. How do I get the
> assembly name as displayed on the project properties dialog?
>
> Tom



 
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
The application requires that assembly office Version 12.0.0.0 be installed in the Global Assembly Cache (GAC) first. Bill Nguyen Microsoft VB .NET 2 30th May 2008 11:17 PM
The located assembly's manifest definition with name 'xxxxxx' does not match the assembly reference??? Bob Rock Microsoft Dot NET 0 22nd Apr 2004 04:09 PM
The located assembly's manifest definition with name 'xxxxxx' does not match the assembly reference??? Bob Rock Microsoft Dot NET Framework 0 22nd Apr 2004 04:09 PM
The located assembly's manifest definition with name 'xxxxxx' does not match the assembly reference??? Bob Rock Microsoft Dot NET Framework 0 22nd Apr 2004 04:06 PM
Restricting access to Assembly.LoadFrom call within an assembly based on strong names Nicholas Paldino [.NET/C# MVP] Microsoft C# .NET 3 9th Dec 2003 08:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:22 PM.