Assembly and Type Name

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Max2006

    #1

    Assembly and Type Name

    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.Documentat ion.EnforceGree tingFaultBehavi or,
    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


  • Marc Gravell

    #2
    Re: Assembly and Type Name

    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(Attribu teCollection).A ssemblyQualifie dName);

    Comment

    • Steven Cheng [MSFT]

      #3
      RE: Assembly and Type Name

      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.N et.Cookie);

      string fullname = type.AssemblyQu alifiedName;

      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:
      msdnmg@microsof t.com.

      =============== =============== =============== =====
      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" <alanalan1@news group.nospam>
      >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="Microsof t.WCF.Documenta tion.EnforceGre etingFaultBehav ior,
      >HostApplicatio n, 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
      >
      >
      >

      Comment

      • Max2006

        #4
        Re: Assembly and Type Name

        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 ``endpointValid ate`` section here:

        "Microsoft.Serv iceModel.Sample s.EndpointValid ateElement, endpointValidat e,
        Version=1.0.0.0 , Culture=neutral , PublicKeyToken= null"

        Thank you for help,
        Max



        "Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
        news:huxxI#o1IH A.3644@TK2MSFTN GHUB02.phx.gbl. ..
        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.N et.Cookie);
        >
        string fullname = type.AssemblyQu alifiedName;
        >
        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:
        msdnmg@microsof t.com.
        >
        =============== =============== =============== =====
        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" <alanalan1@news group.nospam>
        >>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="Microso ft.WCF.Document ation.EnforceGr eetingFaultBeha vior,
        >>HostApplicati on, 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
        >>
        >>
        >>
        >

        Comment

        • Jon Skeet [C# MVP]

          #5
          Re: Assembly and Type Name

          On Jun 25, 4:52 pm, "Max2006" <alanal...@news group.nospamwro te:
          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 ``endpointValid ate`` section here:
          >
          "Microsoft.Serv iceModel.Sample s.EndpointValid ateElement, endpointValidat e,
          Version=1.0.0.0 , Culture=neutral , PublicKeyToken= null"
          Yes it does - that's the name of the assembly containing
          EndPointValidat eElement.

          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

          Comment

          • Steven Cheng [MSFT]

            #6
            Re: Assembly and Type Name

            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/libr...69(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:
            msdnmg@microsof t.com.

            =============== =============== =============== =====
            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" <alanalan1@news group.nospam>
            >References: <E68247B9-82DC-4224-8951-8B63586B224F@mi crosoft.com>
            <huxxI#o1IHA.36 44@TK2MSFTNGHUB 02.phx.gbl>
            >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 ``endpointValid ate`` section here:
            >
            >"Microsoft.Ser viceModel.Sampl es.EndpointVali dateElement, endpointValidat e,
            >Version=1.0.0. 0, Culture=neutral , PublicKeyToken= null"
            >
            >Thank you for help,
            >Max
            >
            >
            >
            >"Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
            >news:huxxI#o1I HA.3644@TK2MSFT NGHUB02.phx.gbl ...
            >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.N et.Cookie);
            >>
            > string fullname = type.AssemblyQu alifiedName;
            >>
            > 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:
            >msdnmg@microsof t.com.
            >>
            >============== =============== =============== ======
            >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" <alanalan1@news group.nospam>
            >>>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="Micros oft.WCF.Documen tation.EnforceG reetingFaultBeh avior,
            >>>HostApplicat ion, 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
            >>>
            >>>
            >>>
            >>
            >

            Comment

            Working...