{"id":17008722,"url":"https://github.com/i-e-b/circularreflection","last_synced_at":"2026-01-31T09:32:24.249Z","repository":{"id":246748845,"uuid":"822437806","full_name":"i-e-b/CircularReflection","owner":"i-e-b","description":"MSBuild task that re-writes classes as abstract definitions, to allow circular references","archived":false,"fork":false,"pushed_at":"2024-07-02T15:25:05.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T13:49:21.153Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/i-e-b.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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-01T06:45:54.000Z","updated_at":"2024-07-02T15:25:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"81324c7b-d03e-436d-8124-9fa397abd7f9","html_url":"https://github.com/i-e-b/CircularReflection","commit_stats":null,"previous_names":["i-e-b/circularreflection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/i-e-b/CircularReflection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FCircularReflection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FCircularReflection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FCircularReflection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FCircularReflection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i-e-b","download_url":"https://codeload.github.com/i-e-b/CircularReflection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FCircularReflection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28936181,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T08:53:31.997Z","status":"ssl_error","status_checked_at":"2026-01-31T08:51:38.521Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2024-10-14T05:29:06.548Z","updated_at":"2026-01-31T09:32:24.233Z","avatar_url":"https://github.com/i-e-b.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CircularReflection\n\nMSBuild task that re-writes classes as abstract definitions, to allow circular references\n\nThis is useful for:\n- Auto-generation of references (such as URLs from ASPNet)\n- Making `nameof(...)` references\n- Making `\u003csee cref=\"...\"/\u003e` references in doc comments\n\nThe resulting types will be available under the `Reflection.` namespace\n\n## Applying the build task to your project\n\n1. Reference the NuGet package in the project that wants to _read_ the types\n2. Add `\u003cInputBase\u003e$(MSBuildProjectDirectory)\\..\\SourceProject\\CsFileDirectory\u003c/InputBase\u003e` into a `\u003cPropertyGroup\u003e` of any project referencing this package\n3. Rebuild, and start referencing types\n\n```xml\n    \u003cPropertyGroup\u003e\n        \u003cReflectionInputBase\u003e$(MSBuildProjectDirectory)\\..\\SourceProject\\CsFileDirectory\u003c/ReflectionInputBase\u003e\n    \u003c/PropertyGroup\u003e\n```\n\n## Referencing types in your project\n\nThe types in the source files will be added with the namespace prefix `Reflection`.\nSo if the source has a class `Me.MyPackage.MyClass`, the generated type will be `Reflection.Me.MyPackage.MyClass`\n\n## Adding more using directives\n\nIf you are referencing files between different targets, you may need to include extra namespaces into the output.\n\n```xml\n    \u003cPropertyGroup\u003e\n        \u003cReflectionAdditionalUsings\u003eSystem;System.Collections.Generic;System.Threading.Tasks;\u003c/ReflectionAdditionalUsings\u003e\n    \u003c/PropertyGroup\u003e\n```\n\n## Removing using directives\n\nTo exclude using directives from the output, add to this list:\n\n```xml\n    \u003cPropertyGroup\u003e\n        \u003cReflectionExcludeUsings\u003eSystem;System.Threading.Task\u003c/ReflectionExcludeUsings\u003e\n    \u003c/PropertyGroup\u003e\n```\n\n## Removing `namespace` Stubs\n\nBy default, each `using ...;` namespace will have a stub class defined for it. This means the generated\ncode should compile without requiring additional code to get generated code to build, but can result in the\ncompiled assembly containing leaked namespaces.\n\nIf you set `ReflectionNamespaceStubs` to  `false`, no stub are added, so namespaces are not leaked into generated assemblies. You may need to\nadd some 'fake' namespaced classes to have a reliable build.\n\n```xml\n    \u003cPropertyGroup\u003e\n        \u003cReflectionNamespaceStubs\u003efalse\u003c/ReflectionNamespaceStubs\u003e\n    \u003c/PropertyGroup\u003e\n```\n\n## Generated files\n\nThe generated files are written to the project's `obj` directory\nin a file named `CircularReflection.generated.cs`.\nThis will be linked into the sources as part of the build.\n\nIf required, the output can be moved with the `ReflectionOutputBase` setting\n\n# Development of the package\n\n## Building the NuGet package\n\nFirst, **always** do a clean and rebuild.\n\nUpdate the versions to match in the project properties ( assembly and nuget), and the nuspec file.\n\nOpen a terminal in the directory of `CircularReflection.csproj`,\nand run the command `dotnet pack -o ..`.\n\n## References\n\n- https://learn.microsoft.com/en-us/visualstudio/msbuild/tutorial-custom-task-code-generation?view=vs-2022\n- https://github.com/dotnet/samples/tree/main/msbuild/custom-task-code-generation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-e-b%2Fcircularreflection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi-e-b%2Fcircularreflection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-e-b%2Fcircularreflection/lists"}