{"id":16473109,"url":"https://github.com/binki/nugetrestoredynamicprojectreference","last_synced_at":"2026-04-17T09:31:56.458Z","repository":{"id":143134240,"uuid":"148067510","full_name":"binki/NuGetRestoreDynamicProjectReference","owner":"binki","description":null,"archived":false,"fork":false,"pushed_at":"2019-05-23T21:51:35.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-30T10:44:38.546Z","etag":null,"topics":["msbuild","nuget"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/binki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2018-09-09T21:31:50.000Z","updated_at":"2019-05-23T21:51:37.000Z","dependencies_parsed_at":"2023-04-10T08:34:35.883Z","dependency_job_id":null,"html_url":"https://github.com/binki/NuGetRestoreDynamicProjectReference","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/binki/NuGetRestoreDynamicProjectReference","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2FNuGetRestoreDynamicProjectReference","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2FNuGetRestoreDynamicProjectReference/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2FNuGetRestoreDynamicProjectReference/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2FNuGetRestoreDynamicProjectReference/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binki","download_url":"https://codeload.github.com/binki/NuGetRestoreDynamicProjectReference/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2FNuGetRestoreDynamicProjectReference/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31923110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T09:10:15.403Z","status":"ssl_error","status_checked_at":"2026-04-17T09:10:14.455Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","nuget"],"created_at":"2024-10-11T12:25:21.979Z","updated_at":"2026-04-17T09:31:56.439Z","avatar_url":"https://github.com/binki.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Demonstration of how to support `msbuild/r` (msbuild with nuget package restore) when adding `\u003cProjectReference/\u003e` via targets.\n\n# Use Case\n\nYou may want to dynamically calculate which projects to include in your build based on configuration such as licensing.\nThus, you develop an MSBuild target which runs prior to `BeforeResolveReferences` to dynamically scan for and add optional projects by adding `\u003cProjectReference/\u003e`.\nHowever, you find that these dynamically added `\u003cProjectReference/\u003e` are ignored by the restore phase of `msbuild/r`.\n\n# Implementation\n\nSee [Runner/Build/AddDynamicReferences.targets](Runner/Build/AddDynamicReferences.targets).\n\n# Pitfalls\n\n## Visual Studio\n\nDynamically adding `\u003cPackageReference/\u003e` is only supported by `msbuild` itself.\nVisual Studio manages build dependencies internally and does not provide a reasonable way to recognize dependencies added by targets.\nYou may choose to instruct Visual Studio to always invoke `msbuild` for builds (is that possible?) or have special logic to write dependencies to files and `\u003cError/\u003e` out and touch the project file to force VS users to reload the project when you detect that you are being built in VS.\n\n## Private API\n\nThis solution relies on a private API.\nI have opened https://github.com/NuGet/Home/issues/7288 to inquire about making this a supported scenario or discovering if there might be some other more acceptable mechanism to achieve the same effect.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinki%2Fnugetrestoredynamicprojectreference","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinki%2Fnugetrestoredynamicprojectreference","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinki%2Fnugetrestoredynamicprojectreference/lists"}