PC Review


Reply
Thread Tools Rate Thread

Assembly and Type Name

 
 
Max2006
Guest
Posts: n/a
 
      25th Jun 2008
Hi,

When I want to specify a type \in web.config or app.config files, I have to
type it like this:

type="Microsoft.WCF.Documentation.EnforceGreetingFaultBehavior,
HostApplication, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"

The name is usually long especially if it is a strongly named assembly and
we have to type PublicKeyToken.

Is there any tool that I can use to copy and paste the type name?

Thank you,
Max


 
Reply With Quote
 
 
 
 
Marc Gravell
Guest
Posts: n/a
 
      25th Jun 2008
I don't know if there is an easier way - but I usually just throw
something like below into the code and copy it from the output
window...

Debug.WriteLine(typeof(AttributeCollection).AssemblyQualifiedName);
 
Reply With Quote
 
Steven Cheng [MSFT]
Guest
Posts: n/a
 
      25th Jun 2008
For the full type name you need to put in configuratin file, it is actually
called "Assembly qualified name". For complex type and assmebly, I usually
use the following code to print them out:

==================
Type type = typeof(System.Net.Cookie);

string fullname = type.AssemblyQualifiedName;

Response.Write("<br/>" + fullname);
=========================

Or you can also use some tool such as reflector to inspect assembly's
FullName and append them to the Full typename so as to make up the Full
assembly qualified type name.

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(E-Mail Removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "Max2006" <(E-Mail Removed)>
>Subject: Assembly and Type Name
>Date: Tue, 24 Jun 2008 20:56:43 -0400


>
>Hi,
>
>When I want to specify a type \in web.config or app.config files, I have

to
>type it like this:
>
>type="Microsoft.WCF.Documentation.EnforceGreetingFaultBehavior,
>HostApplication, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
>
>The name is usually long especially if it is a strongly named assembly and
>we have to type PublicKeyToken.
>
>Is there any tool that I can use to copy and paste the type name?
>
>Thank you,
>Max
>
>
>


 
Reply With Quote
 
Max2006
Guest
Posts: n/a
 
      25th Jun 2008
Hi Steven,

Could you refer me to any documentation that explains the syntax for
"Assembly qualified name"?

I had a look at this:

http://msdn.microsoft.com/en-us/library/k8xx4k69.aspx

However, it doesn't explain the ``endpointValidate`` section here:

"Microsoft.ServiceModel.Samples.EndpointValidateElement, endpointValidate,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"

Thank you for help,
Max



"Steven Cheng [MSFT]" <(E-Mail Removed)> wrote in message
news:huxxI#(E-Mail Removed)...
> For the full type name you need to put in configuratin file, it is
> actually
> called "Assembly qualified name". For complex type and assmebly, I
> usually
> use the following code to print them out:
>
> ==================
> Type type = typeof(System.Net.Cookie);
>
> string fullname = type.AssemblyQualifiedName;
>
> Response.Write("<br/>" + fullname);
> =========================
>
> Or you can also use some tool such as reflector to inspect assembly's
> FullName and append them to the Full typename so as to make up the Full
> assembly qualified type name.
>
> Hope this helps.
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> (E-Mail Removed).
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscripti...ult.aspx#notif
> ications.
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> --------------------
>>From: "Max2006" <(E-Mail Removed)>
>>Subject: Assembly and Type Name
>>Date: Tue, 24 Jun 2008 20:56:43 -0400

>
>>
>>Hi,
>>
>>When I want to specify a type \in web.config or app.config files, I have

> to
>>type it like this:
>>
>>type="Microsoft.WCF.Documentation.EnforceGreetingFaultBehavior,
>>HostApplication, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
>>
>>The name is usually long especially if it is a strongly named assembly and
>>we have to type PublicKeyToken.
>>
>>Is there any tool that I can use to copy and paste the type name?
>>
>>Thank you,
>>Max
>>
>>
>>

>

 
Reply With Quote
 
Jon Skeet [C# MVP]
Guest
Posts: n/a
 
      25th Jun 2008
On Jun 25, 4:52 pm, "Max2006" <alanal...@newsgroup.nospam> wrote:
> Could you refer me to any documentation that explains the syntax for
> "Assembly qualified name"?
>
> I had a look at this:
>
> http://msdn.microsoft.com/en-us/library/k8xx4k69.aspx
>
> However, it doesn't explain the ``endpointValidate`` section here:
>
> "Microsoft.ServiceModel.Samples.EndpointValidateElement, endpointValidate,
> Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"


Yes it does - that's the name of the assembly containing
EndPointValidateElement.

It's a slightly odd name for an assembly, admittedly, but it's
basically okay.

See http://msdn.microsoft.com/en-us/libr...ifiedname.aspx
for some more examples.

Jon
 
Reply With Quote
 
Steven Cheng [MSFT]
Guest
Posts: n/a
 
      26th Jun 2008
Hi Max,

As for the Assembly Qaulified name, it is actually combined with two parts:

1. The full type name

2. The full assemby name

For the type's fullname, it's quite straightforard, just
[Namespace]+[TypeName]

For assembly full name, you can refer to the following reference:

#Assembly Names
http://msdn.microsoft.com/en-us/library/k8xx4k69(VS.71).aspx

#Assembly Display Names
http://blogs.msdn.com/suzcook/archiv.../29/57137.aspx

a full assembly name contains [AssemblyName], [Version],[Culture],[Public
Key Token]

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(E-Mail Removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: "Max2006" <(E-Mail Removed)>
>References: <E68247B9-82DC-4224-8951-(E-Mail Removed)>

<huxxI#(E-Mail Removed)>
>Subject: Re: Assembly and Type Name
>Date: Wed, 25 Jun 2008 11:52:23 -0400


>
>Hi Steven,
>
>Could you refer me to any documentation that explains the syntax for
>"Assembly qualified name"?
>
>I had a look at this:
>
>http://msdn.microsoft.com/en-us/library/k8xx4k69.aspx
>
>However, it doesn't explain the ``endpointValidate`` section here:
>
>"Microsoft.ServiceModel.Samples.EndpointValidateElement, endpointValidate,
>Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
>
>Thank you for help,
>Max
>
>
>
>"Steven Cheng [MSFT]" <(E-Mail Removed)> wrote in message
>news:huxxI#(E-Mail Removed)...
>> For the full type name you need to put in configuratin file, it is
>> actually
>> called "Assembly qualified name". For complex type and assmebly, I
>> usually
>> use the following code to print them out:
>>
>> ==================
>> Type type = typeof(System.Net.Cookie);
>>
>> string fullname = type.AssemblyQualifiedName;
>>
>> Response.Write("<br/>" + fullname);
>> =========================
>>
>> Or you can also use some tool such as reflector to inspect assembly's
>> FullName and append them to the Full typename so as to make up the Full
>> assembly qualified type name.
>>
>> Hope this helps.
>>
>> Sincerely,
>>
>> Steven Cheng
>>
>> Microsoft MSDN Online Support Lead
>>
>>
>> Delighting our customers is our #1 priority. We welcome your comments and
>> suggestions about how we can improve the support we provide to you.

Please
>> feel free to let my manager know what you think of the level of service
>> provided. You can send feedback directly to my manager at:
>> (E-Mail Removed).
>>
>> ==================================================
>> Get notification to my posts through email? Please refer to
>>

http://msdn.microsoft.com/subscripti...ult.aspx#notif
>> ications.
>> ==================================================
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> --------------------
>>>From: "Max2006" <(E-Mail Removed)>
>>>Subject: Assembly and Type Name
>>>Date: Tue, 24 Jun 2008 20:56:43 -0400

>>
>>>
>>>Hi,
>>>
>>>When I want to specify a type \in web.config or app.config files, I have

>> to
>>>type it like this:
>>>
>>>type="Microsoft.WCF.Documentation.EnforceGreetingFaultBehavior,
>>>HostApplication, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
>>>
>>>The name is usually long especially if it is a strongly named assembly

and
>>>we have to type PublicKeyToken.
>>>
>>>Is there any tool that I can use to copy and paste the type name?
>>>
>>>Thank you,
>>>Max
>>>
>>>
>>>

>>

>


 
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 type 'frm_data.frm_data' is defined in an assembly that is not referenced. You must add a reference to assembly ma79ash@gmail.com Microsoft C# .NET 3 4th Oct 2007 12:40 PM
Load Assembly Type.GetType("Class,Assembly") Mohamed Zaki Microsoft Dot NET Framework 4 7th Jan 2006 06:32 PM
Type.GetType - can you get the type of an assembly located in a subdirectory? Benny Raymond Microsoft C# .NET 1 17th Nov 2005 06:02 AM
Get Assembly Type Names Without Loading The Assembly Neo Microsoft Dot NET 11 25th Oct 2005 10:54 PM
[Assembly] gives "Type 'Assembly' not defined" error PKuhne Microsoft VB .NET 2 3rd Jul 2005 12:35 PM


Features
 

Advertising
 

Newsgroups
 


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