Skip to content

AssemblyInfo: Determine which properties will be generated and their msbuild mappings #2

Closed

Description

@brthor

In dotnet cli AssemblyInfo is generated during each build from properties present in the project.json file. MSBuild currently relies on a template generated or user created AssemblyInfo to be present.

For certain options which need to be present in the csproj for pack (or other mechanisms) to function, it doesn't make sense to require putting these in both the project and AssemblyInfo.cs. (e.g. language )

For this reason it makes sense to generate a subset of the assemblyinfo from the project during build, and leave the rest to be manually entered.

To do this we need to determine what the subset of AssemblyInfo is that we're generating and how they map to msbuild options.

Activity

  1. changed the title [-]AssemblyInfo: Determine which properties will be generated and their msbuild mappins[/-] [+]AssemblyInfo: Determine which properties will be generated and their msbuild mappings[/+] on Jul 28, 2016
  2. davkean commented on Aug 1, 2016

    @davkean
    Member
  3. davkean commented on Aug 8, 2016

    @davkean
    Member

    @brthor, I and the NuGet team sat down together and came up with the following maps:

    Attribute/NuSpec value Type MSBuild Property Default Notes
    AssemblyTitle Attribute AssemblyTitle AssemblyName
    AssemblyDescription Attribute N/A Description
    AssemblyConfiguration Attribute Configuration Debug Existing property
    AssemblyCompany Attribute AssemblyCompany Authors
    AssemblyProduct Attribute Product AssemblyName
    AssemblyCopyright Attribute N/A Copyright
    AssemblyTrademark Attribute N/A Not present Developers can define attribute if they want to set it
    AssemblyCulture Attribute N/A Not present Developers can define attribute if they want to set it
    ComVisible Attribute N/A Not present
    Guid Attribute N/A Not present Developers can define attribute if they want to set it
    NeutralResourcesLanguage Attribute NeutralLanguage
    AssemblyInformationalVersion Attribute Version 1.0.0 Make note this is SemVer version (ie 1.0.0-beta1 is valid)
    AssemblyVersion Attribute AssemblyVersion Version (major.minor.patch components only)
    AssemblyFileVersion Attribute FileVersion major.minor.patch components only of Version
    PackageId NuSpec PackageId AssemblyName
    PackageVersion NuSpec PackageVersion Version
    Authors NuSpec Authors AssemblyName
    Owners NuSpec N/A Not present in NuSpec
    Description NuSpec Description empty
    Copyright NuSpec Copyright empty
    Summary NuSpec N/A Not present in NuSpec
    RequireLicenseAcceptance NuSpec PackageRequireLicenseAcceptance false
    LicenseUrl NuSpec PackageLicenseUrl empty
    ProjectUrl NuSpec PackageProjectUrl empty
    IconUrl NuSpec PackageIconUrl empty
    Tags NuSpec PackageTags empty
    ReleaseNotes NuSpec PackageReleaseNotes empty
    RepositoryUrl NuSpec RepositoryUrl empty
    RepositoryType NuSpec RepositoryType empty
    PackageType NuSpec ? NuGet will go offline and figure out this design
    
    EDIT: 10/17/2016 by eerhardt - Add $(AssemblyCompany) as the MSBuild property for AssemblyCompany.  There are plenty of cases where users want to define AssemblyCompany differently from their nupkg Authors.  CoreFX is the first place I've found: AssemblyCompany = "Microsoft Corporation", but Authors = "microsoft;aspnet;dotnetframework".
    Also added Authors to be defaulted to "AssemblyName" so `dotnet pack` works by default.
    
  4. brthor commented on Aug 9, 2016

    @brthor
    ContributorAuthor
  5. davkean commented on Aug 9, 2016

    @davkean
    Member

    Ah yes, Language is programming language. Let's pick NeutralLanguage for now.

  6. nguerrera commented on Aug 16, 2016

    @nguerrera
    Contributor

    @davkean, @brthor, @srivatsn: I'm going to look at generating the AssemblyInfo.cs. Should we morph this issue to track the task and targets changes, or should I create a new tracking issue? Seems like the original issue to come up with the set of mappings is done with the table above, right?

  7. brthor commented on Aug 16, 2016

    @brthor
    ContributorAuthor

    I think it makes sense to leave this issue independent from the tracking of generating the assembly info.

    My reasoning is that I expect as you dig in to generating these things, you might find that some of the properties need to change and update this issue. I'll need to react to these changes in the migration tool. It'll be easier to recognize this with less noise on the issue.

  8. nguerrera commented on Aug 16, 2016

    @nguerrera
    Contributor

    @brthor OK. Opened #57

  9. mrward commented on Sep 9, 2016

    @mrward
    Contributor

    Are summary and owners no longer supported?

    Summary is displayed by the NuGet UI in the package list if the NuGet package defines it instead of the description which can be a large amount of text.

  10. srivatsn commented on Sep 19, 2016

    @srivatsn
    Contributor

    Is there any work left here? @brthor @nguerrera

  11. brthor commented on Sep 19, 2016

    @brthor
    ContributorAuthor

    @rohit21agrawal Has there been a decision on the PackageType mapping?

  12. rohit21agrawal commented on Sep 19, 2016

    @rohit21agrawal
    Contributor

    <PackageType>DotNetCliTool, 1.0.0.0;Dependency, 2.0.0.0</PackageType>

  13. brthor commented on Sep 19, 2016

    @brthor
    ContributorAuthor

    How can PackageType to be inferred from a migrated project? Is it even possible? or should it always be Dependency

  14. rohit21agrawal commented on Sep 19, 2016

    @rohit21agrawal
    Contributor

    the default is to not have a package type, which the client deduces to be of type dependency. on the more finer details, @joelverhagen will have an answer

  15. 15 remaining items

  16. srivatsn commented on Nov 21, 2016

    @srivatsn
    Contributor

    Is there any work left here?

  17. nguerrera commented on Nov 21, 2016

    @nguerrera
    Contributor

    I don't think so. Closing.

  18. added a commit that references this issue on Jun 5, 2020
  19. added a commit that references this issue on Dec 23, 2022
  20. added a commit that references this issue on Nov 19, 2024
  21. added a commit that references this issue on Mar 17, 2026
  22. added theissue type on Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions