{"id":15011529,"url":"https://github.com/icnocop/migratepackagesconfigtopackagereferencesextension","last_synced_at":"2025-04-12T04:05:17.575Z","repository":{"id":249304932,"uuid":"831137617","full_name":"icnocop/MigratePackagesConfigToPackageReferencesExtension","owner":"icnocop","description":"Migrates packages.config to PackageReferences. Works with C# csproj and native C++ vcxproj Visual Studio project files.","archived":false,"fork":false,"pushed_at":"2024-07-31T12:36:23.000Z","size":110,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T04:05:05.363Z","etag":null,"topics":["nuget","packagereference","packages-config","vcxproj"],"latest_commit_sha":null,"homepage":"","language":"C#","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/icnocop.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}},"created_at":"2024-07-19T18:45:48.000Z","updated_at":"2024-11-13T10:57:26.000Z","dependencies_parsed_at":"2024-07-31T06:57:54.917Z","dependency_job_id":"8ec3a616-5458-41a1-b868-be11c825c75f","html_url":"https://github.com/icnocop/MigratePackagesConfigToPackageReferencesExtension","commit_stats":{"total_commits":28,"total_committers":1,"mean_commits":28.0,"dds":0.0,"last_synced_commit":"2f5f7f0ac7f18245902869d8fb2c8bfdfbfac1d0"},"previous_names":["icnocop/migratepackagesconfigtopackagereferencesextension"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icnocop%2FMigratePackagesConfigToPackageReferencesExtension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icnocop%2FMigratePackagesConfigToPackageReferencesExtension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icnocop%2FMigratePackagesConfigToPackageReferencesExtension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icnocop%2FMigratePackagesConfigToPackageReferencesExtension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icnocop","download_url":"https://codeload.github.com/icnocop/MigratePackagesConfigToPackageReferencesExtension/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514228,"owners_count":21116903,"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","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":["nuget","packagereference","packages-config","vcxproj"],"created_at":"2024-09-24T19:41:12.725Z","updated_at":"2025-04-12T04:05:17.537Z","avatar_url":"https://github.com/icnocop.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Migrate packages.config to PackageReferences\n\nThis Visual Studio extension migrates packages.config to PackageReferences.\n\nIt works with C# csproj and native C++ vcxproj Visual Studio project files.\n\n[Download it from the Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=RamiAbughazaleh.MigratePackagesConfigToPackageReferencesExtension)\n\n## Getting started\n\n1. Download and install the extension.  \n2. Right-click on `packages.config` and select `Migrate packages.config to PackageReferences...`.  \n\n![Preview](Preview.png)\n\n3. Wait until the process finishes.  \n  Check the status bar or the `Migrate packages.config to PackageReferences Extension` pane in the `Output Window` for details.\n\n\n## Technical Details\n\nThis extension will first create a backup of the project and `packages.config` files.  \nFor example, `MyProject.vcxproj` and `packages.config` will be copied to `MyProject.vcxproj.bak` and `packages.config.bak` respectively.  \n\nIf the project and `packages.config` files are source controlled, they will be checked out for modification.  \n\nThe NuGet packages referenced in `packages.config` will be migrated to the project file in the new `PackageReference` format.  \nFor example, the following elements in the `vcxproj` project file:\n```\n  \u003cImport Project=\"..\\packages\\MyPackage.1.0.0\\build\\MyPackage.props\" Condition=\"Exists('..\\packages\\MyPackage.1.0.0\\build\\MyPackage.props')\" /\u003e\n\n  \u003cItemGroup\u003e\n    \u003cNone Include=\"packages.config\" /\u003e\n  \u003c/ItemGroup\u003e\n\n  \u003cTarget Name=\"EnsureNuGetPackageBuildImports\" BeforeTargets=\"PrepareForBuild\"\u003e\n    \u003cPropertyGroup\u003e\n      \u003cErrorText\u003eThis project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.\u003c/ErrorText\u003e\n    \u003c/PropertyGroup\u003e\n    \u003cError Condition=\"!Exists('..\\packages\\MyPackage.1.0.0\\build\\MyPackage.props')\" Text=\"$([System.String]::Format('$(ErrorText)', '..\\packages\\MyPackage.1.0.0\\build\\MyPackage.props'))\" /\u003e\n  \u003c/Target\u003e\n```\n\nwill be converted to this:\n```\n  \u003cItemGroup\u003e\n    \u003cPackageReference Include=\"MyPackage\" Version=\"1.0.0\" /\u003e\n  \u003c/ItemGroup\u003e\n```\n\n\nAfter the project file has been updated, `packages.config` will be deleted, and the project reloaded.\n\n\n## Troubleshooting\n\nCheck the `Migrate packages.config to PackageReferences Extension` pane in the `Output Window` for detailed logs.\n\n## References\n\n- [Visual Studio Developer Community Feedback: Use PackageReference in vcxproj](https://developercommunity.visualstudio.com/t/Use-PackageReference-in-vcxproj/351636)  \n- [StackOverflow Question: PackageReference for NuGet packages in C++ projects](https://stackoverflow.com/q/50599104/90287)  \n- [Github dotnet project-system issue: Make the PackageReference support general purpose for all languages](https://github.com/dotnet/project-system/issues/2491)  \n- [Github Repo: Example C++ project that uses NuGet PackageReference (instead of packages.config)](https://github.com/japj/CppWithNuGetPackageReference)  \n- [Microsoft C++ Dev Blog: Announcing NuGet PackageReference support for C++/CLI MSBuild projects targeting .NET Core and .NET 5 or higher](https://devblogs.microsoft.com/cppblog/announcing-nuget-packagereference-support-for-c-cli-msbuild-projects-targeting-net-core/)  \n- [Microsoft Learn Docs: Migrate from packages.config to PackageReference](https://learn.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference)  \n\n- [Software Meadows Blog Post: Revert PackageReference Project to Packages.config](https://www.softwaremeadows.com/posts/revert_packagereference_project_to_packages_config/)  \n- [StackOverflow Question: Switch back to packages.config](https://stackoverflow.com/q/45962998/90287)\n- [Visual Studio 2017 Extension: NuGet PackageReference Upgrader](https://github.com/CloudNimble/PackageReferenceUpgrader)\n\n## Why was this extension created? Visual Studio 2017 Version 15.7 and later has this feature already.\n\nThe feature built-into Visual Studio 2017 Version 15.7 and later does not support native C++ projects.\n\nThe following error appears:\n\n![image](https://github.com/user-attachments/assets/e740ec76-6cf8-405c-858e-1bc18cd833e6)\n\n\u003e Project is not eligible for migration. Either the project is not packages.config based or doesn't support PackageReference yet. Visit https://docs.microsoft.com/en-us/nuget/reference/migrate-packages-config-to-package-reference for more information.\n\n\n## Rate and Review\n\nHas this extension helped you at all?\n\nIf so, please rate and share it.\n\nThank you! :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficnocop%2Fmigratepackagesconfigtopackagereferencesextension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficnocop%2Fmigratepackagesconfigtopackagereferencesextension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficnocop%2Fmigratepackagesconfigtopackagereferencesextension/lists"}