locked
How do I add assembly information for a WinRT C++ / CX component dll?

    Question

  • How do I add assembly information for a WinRT C++ / CX component dll?
    Friday, August 10, 2012 4:06 AM

Answers

  • You can't set the version. Your components will show the same version 255.255.255.255 if you manually reference them from another project.

    PS: Also, you should not manually reference any winmds from the Windows folder. The design-time winmd called Windows.winmd should be automatically referenced by all WinRT project templates. In case your starting point is not a new template, make sure that LIBPATH environment variable includes "Windows Kits\8.0\References\CommonConfiguration\Neutral" from under "Program Files" or "Program Files (x86)".

    Marian Luparu
    Visual C++

    • Proposed as answer by Jesse Jiang Thursday, August 16, 2012 3:23 AM
    • Marked as answer by Jesse Jiang Monday, August 20, 2012 6:00 AM
    Tuesday, August 14, 2012 2:02 AM
  • For a project-to-project reference, the version would be 0.0.0.0 because the winmd is not even read (Project System only looks at the referenced vcxproj file). When you add a winmd reference directly, you should see 255.255.255.255. At least that's what I am seeing with the RTM build of VS. But either way, version of the actual assembly is not important.

    If you believe there is a compeling scenario where you find these assembly-level attributes useful (and specifically version) in WinRT, let us know and maybe that's something the Windows team can look at in the next release.

    Marian Luparu
    Visual C++

    Tuesday, August 14, 2012 10:23 PM

All replies

  • Hello,

     

    Thanks for your feedback, I will involve more experts to investigate it.

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Monday, August 13, 2012 11:52 AM
  • Can you clarify what you're trying to do?
    Monday, August 13, 2012 8:23 PM
    Moderator
  • I'm trying to find out how to add assembly information for a WinRT C++ / CX component.  You know how when you add it to your C# project as a reference, and then look at the "Version"?  Well by default, it says "0.0.0.0".  How do we change that?

    In .NET, we used attributes available in System.Reflection, such as:

    [assembly:AssemblyTitleAttribute("some value")];
    [assembly:AssemblyDescriptionAttribute("some value")];
    [assembly:AssemblyCompanyAttribute("some value")];
    [assembly:AssemblyProductAttribute("some value")];
    [assembly:AssemblyCopyrightAttribute("some value")];
    [assembly:AssemblyTrademarkAttribute("some value")];
    [assembly:AssemblyVersionAttribute("some value")];
    

    Monday, August 13, 2012 9:27 PM
  • The attributes you mentioned are CLR attributes. There are no equivalent WinRT attributes defined for this.

    If you need some form of tagging for your own winmds, you could define new attributes and then use them. But note that WinRT attributes at assembly scope (aka [assembly:...]) or module scope (aka [module:...]) are not supported. Take a look at Windows::Foundation::Metadata::AttributeTargets for a list of supported targets.

    Thanks,
    Marian Luparu
    Visual C++

    Tuesday, August 14, 2012 12:21 AM
  • Let me try to explain more.

    I created a new, blank C++ Metro Style application project in VS 2012.

    I added a reference to the Windows.Data.winmd file from the following folder:

    C:\Windows\WinSxS\wow64_microsoft-windows-runtime-metadata_31bf3856ad364e35_6.2.8400.0_none_2090e9e0cc9fce69

    In the references property page, there is a property called Version, that is set to 255.255.255.255.

    How do I set this for my components?

    Tuesday, August 14, 2012 1:50 AM
  • You can't set the version. Your components will show the same version 255.255.255.255 if you manually reference them from another project.

    PS: Also, you should not manually reference any winmds from the Windows folder. The design-time winmd called Windows.winmd should be automatically referenced by all WinRT project templates. In case your starting point is not a new template, make sure that LIBPATH environment variable includes "Windows Kits\8.0\References\CommonConfiguration\Neutral" from under "Program Files" or "Program Files (x86)".

    Marian Luparu
    Visual C++

    • Proposed as answer by Jesse Jiang Thursday, August 16, 2012 3:23 AM
    • Marked as answer by Jesse Jiang Monday, August 20, 2012 6:00 AM
    Tuesday, August 14, 2012 2:02 AM
  • First, I used the .winmd files from the Windows folder just as an illustration.

    Second, when I add a reference to my own .winmd for my own component which was created using the VS new project wizard, the Version shows as 0.0.0.0.

    If WinRT component's can't have assembly version information, then I guess that's ok, but it seems like yet another step backwards from what we had with .NET / CLR.

    Tuesday, August 14, 2012 4:12 PM
  • For a project-to-project reference, the version would be 0.0.0.0 because the winmd is not even read (Project System only looks at the referenced vcxproj file). When you add a winmd reference directly, you should see 255.255.255.255. At least that's what I am seeing with the RTM build of VS. But either way, version of the actual assembly is not important.

    If you believe there is a compeling scenario where you find these assembly-level attributes useful (and specifically version) in WinRT, let us know and maybe that's something the Windows team can look at in the next release.

    Marian Luparu
    Visual C++

    Tuesday, August 14, 2012 10:23 PM