{"id":28452056,"url":"https://github.com/gcsizmadia/egonsofthu.nuspecproperties","last_synced_at":"2025-08-12T21:08:27.573Z","repository":{"id":82879425,"uuid":"452128089","full_name":"gcsizmadia/EgonsoftHU.NuspecProperties","owner":"gcsizmadia","description":"MSBuild Support for \u003cowners\u003e and \u003csummary\u003e .nuspec metadata elements","archived":false,"fork":false,"pushed_at":"2022-02-05T01:50:21.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-02T03:37:35.204Z","etag":null,"topics":["msbuild","msbuild-properties","msbuild-target","msbuild-task","nuget","nuget-package-documentation"],"latest_commit_sha":null,"homepage":"","language":"XML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gcsizmadia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-01-26T03:28:50.000Z","updated_at":"2022-06-27T21:20:58.000Z","dependencies_parsed_at":"2023-03-30T22:03:56.948Z","dependency_job_id":null,"html_url":"https://github.com/gcsizmadia/EgonsoftHU.NuspecProperties","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gcsizmadia/EgonsoftHU.NuspecProperties","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcsizmadia%2FEgonsoftHU.NuspecProperties","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcsizmadia%2FEgonsoftHU.NuspecProperties/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcsizmadia%2FEgonsoftHU.NuspecProperties/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcsizmadia%2FEgonsoftHU.NuspecProperties/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gcsizmadia","download_url":"https://codeload.github.com/gcsizmadia/EgonsoftHU.NuspecProperties/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcsizmadia%2FEgonsoftHU.NuspecProperties/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270135076,"owners_count":24533203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["msbuild","msbuild-properties","msbuild-target","msbuild-task","nuget","nuget-package-documentation"],"created_at":"2025-06-06T17:10:42.994Z","updated_at":"2025-08-12T21:08:27.565Z","avatar_url":"https://github.com/gcsizmadia.png","language":"XML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MSBuild support for deprecated NuGet metadata elements\n\n[![GitHub](https://img.shields.io/github/license/gcsizmadia/EgonsoftHU.NuspecProperties?label=License)](https://opensource.org/licenses/MIT)\n\nAccording to [.nuspec File Reference for NuGet](https://docs.microsoft.com/en-us/nuget/reference/nuspec) the following metadata elements are deprecated:\n\n- [owners](https://docs.microsoft.com/en-us/nuget/reference/nuspec#owners)\n  \u003e `owners` is deprecated. Use `authors` instead.\n- [summary](https://docs.microsoft.com/en-us/nuget/reference/nuspec#summary)\n  \u003e `summary` is being deprecated. Use `description` instead.\n\nHowever, you might still want to include these metadata elements in your NuGet package for whatever reason.\n\n## Solution\n\nI have created a `.targets` file for MSBuild which can utilize the `\u003cOwners\u003e` and the `\u003cSummary\u003e` MSBuild properties.\n\nAll you have to do is some simple steps:\n- Save `EgonsoftHU.NuspecProperties.targets` file to a location from where it can be referenced from your solution/project.\n- Import `EgonsoftHU.NuspecProperties.targets` file into your project file (e.g. `.csproj`) or into your `Directory.Build.targets` file, if you have such file.\n- Set `\u003cOwners\u003e` and/or `\u003cSummary\u003e` MSBuild properties.\n\n### Import the `.targets` file\n\nLet's assume you have a Git repository with these files:\n- `{gitrepo}\\Directory.Build.targets`\n- `{gitrepo}\\Build\\EgonsoftHU.NuspecProperties.targets`\n\nThe content of the `Directory.Build.targets` file may look like this:\n```xml\n\u003cProject\u003e\n\n  \u003cPropertyGroup\u003e\n    \u003cEgonsoftHUNuspecPropertiesTargetsFile\u003e$(MSBuildThisFileDirectory)Build\\EgonsoftHU.NuspecProperties.targets\u003c/EgonsoftHUNuspecPropertiesTargetsFile\u003e\n  \u003c/PropertyGroup\u003e\n\n  \u003cImport Project=\"$(EgonsoftHUNuspecPropertiesTargetsFile)\" Condition=\"Exists('$(EgonsoftHUNuspecPropertiesTargetsFile)')\" /\u003e\n\n\u003c/Project\u003e\n```\n\n### Set `\u003cOwners\u003e` and/or `\u003cSummary\u003e` MSBuild properties\n\nLet's assume you have a Git repository with this file:\n- `{gitrepo}\\src\\YourProject\\YourProject.csproj`\n\nThe content of the `YourProject.csproj` file may look like this:\n```xml\n\u003cProject Sdk=\"Microsoft.NET.Sdk\"\u003e\n\n  \u003cPropertyGroup\u003e\n    \u003cAuthors\u003eYour profile name on nuget.org\u003c/Authors\u003e\n    \u003cOwners\u003eYour profile name on nuget.org\u003c/Owners\u003e\n    \u003cDescription\u003eA description of the package for UI display. When uploading a package to nuget.org, the description field is limited to 4000 characters.\u003c/Description\u003e\n    \u003cSummary\u003eA short description of the package for UI display. If omitted, a truncated version of description is used.\u003c/Summary\u003e\n  \u003c/PropertyGroup\u003e\n\n  \u003c!-- The rest is omitted for clarity. --\u003e\n\n\u003c/Project\u003e\n```\n\n## How it works\n\nWhen the `Pack` MSBuild target finishes then the followings happen:\n- The `.nupkg` file will be extracted to a temporary folder.\n- If either the `\u003cOwners\u003e` or the `\u003cSummary\u003e` MSBuild property is set then the extracted `.nuspec` file will be modified.\n  - The `owners` element will be added after the `authors` element.\n  - The `summary` element will be added after the `description` element.\n- The content of the temporary folder will be zipped into the original `.nupkg` file by overwriting it.\n- The temporary folder will be deleted.\n\n### Example build output\n\n```\n======================================\nEgonsoft.HU NuGet package updater v1.0\n======================================\nAuthor        : Gabor Csizmadia\nDescription   : Update .nuspec file by adding owners and summary elements using Owners and Summary MSBuild properties.\n--------------------------------------\nCreating temporary folder...\n  Folder      : [P:\\GIT\\EgonsoftHU.Extensions\\nupkgs\\243a2f2f-35e3-4e88-b7f6-1c9f8876d145]\n--------------------------------------\nUnzipping .nupkg file to the temporary folder...\n  .nupkg file : [P:\\GIT\\EgonsoftHU.Extensions\\nupkgs\\EgonsoftHU.Extensions.Bcl.1.0.0.nupkg]\n  Folder      : [P:\\GIT\\EgonsoftHU.Extensions\\nupkgs\\243a2f2f-35e3-4e88-b7f6-1c9f8876d145]\n--------------------------------------\nUpdating .nuspec file...\n  .nuspec file: [P:\\GIT\\EgonsoftHU.Extensions\\nupkgs\\243a2f2f-35e3-4e88-b7f6-1c9f8876d145\\EgonsoftHU.Extensions.Bcl.nuspec]\n  Owners      : [Egonsoft.HU]\n  Summary     : [Extension methods for BCL types]\n\nThe .nuspec file was found.\nLoading .nuspec file...\nGetting default XML namespace...\nGetting \u003cmetadata\u003e node...\nGetting \u003cauthors\u003e node...\nAppending \u003cowners\u003e node...\nGetting \u003cdescription\u003e node...\nAppending \u003csummary\u003e node...\nSaving .nuspec file...\n--------------------------------------\nCreating new .nupkg file from the contents of the temporary folder...\n  .nupkg file : [P:\\GIT\\EgonsoftHU.Extensions\\nupkgs\\EgonsoftHU.Extensions.Bcl.1.0.0.nupkg]\n  Folder      : [P:\\GIT\\EgonsoftHU.Extensions\\nupkgs\\243a2f2f-35e3-4e88-b7f6-1c9f8876d145]\n\nZipping directory \"P:\\GIT\\EgonsoftHU.Extensions\\nupkgs\\243a2f2f-35e3-4e88-b7f6-1c9f8876d145\" to \"P:\\GIT\\EgonsoftHU.Extensions\\nupkgs\\EgonsoftHU.Extensions.Bcl.1.0.0.nupkg\".\n--------------------------------------\nDeleting temporary folder...\n  Folder      : [P:\\GIT\\EgonsoftHU.Extensions\\nupkgs\\243a2f2f-35e3-4e88-b7f6-1c9f8876d145]\n--------------------------------------\nThe new .nupkg file has been created...\n  .nupkg file : [P:\\GIT\\EgonsoftHU.Extensions\\nupkgs\\EgonsoftHU.Extensions.Bcl.1.0.0.nupkg]\n======================================\n```\n\n## Notes\n\n### `Directory.Build.props` and `Directory.Build.targets` files\n\nIf you are not yet familiar with these files then I suggest to check how to [Customize your build](https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2022).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgcsizmadia%2Fegonsofthu.nuspecproperties","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgcsizmadia%2Fegonsofthu.nuspecproperties","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgcsizmadia%2Fegonsofthu.nuspecproperties/lists"}