{"id":16209927,"url":"https://github.com/annulusgames/csprojlangversionprocessor","last_synced_at":"2025-03-02T08:35:03.520Z","repository":{"id":216310338,"uuid":"740977598","full_name":"annulusgames/CsprojLangVersionProcessor","owner":"annulusgames","description":"A Unity editor extension that automatically overrides the LangVersion property of csproj files and allows the latest C# version to work in the IDE.","archived":false,"fork":false,"pushed_at":"2024-03-26T11:27:03.000Z","size":167,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-02T03:24:15.686Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/annulusgames.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-01-09T13:09:13.000Z","updated_at":"2025-01-29T17:40:05.000Z","dependencies_parsed_at":"2024-01-09T15:27:38.957Z","dependency_job_id":"7de32ab8-4575-4bc9-b9d8-d021f0cb8842","html_url":"https://github.com/annulusgames/CsprojLangVersionProcessor","commit_stats":null,"previous_names":["annulusgames/csprojlangversionprocessor","yn01dev/csprojlangversionprocessor","yn01-dev/csprojlangversionprocessor"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annulusgames%2FCsprojLangVersionProcessor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annulusgames%2FCsprojLangVersionProcessor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annulusgames%2FCsprojLangVersionProcessor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annulusgames%2FCsprojLangVersionProcessor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/annulusgames","download_url":"https://codeload.github.com/annulusgames/CsprojLangVersionProcessor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241481967,"owners_count":19969833,"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":[],"created_at":"2024-10-10T10:34:11.012Z","updated_at":"2025-03-02T08:35:03.487Z","avatar_url":"https://github.com/annulusgames.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CsprojLangVersionProcessor\n A Unity editor extension that automatically overrides the LangVersion property of csproj files and allows the latest C# version to work in the IDE.\n\n[日本語版READMEはこちら](README_JA.md)\n\n## Overview\n\nCsproj LangVersion Processor is an editor extension for overriding the `LangVersion` property in csproj files generated by Unity to enable C# 10.0 (11.0) equivalent language features to work in the IDE.\n\nCurrently, the C# version officially supported by Unity remains at 9.0. However, starting from Unity 2022.2, the internal compiler version used by Unity has been updated, allowing the compilation of C# 10.0 language features. Additionally, from Unity 2022.3.12f1 onwards, language features equivalent to C# 11.0 are compilable.\n\nTherefore, by explicitly passing `-langVersion:preview` to the compiler options, it becomes possible to make C# versions beyond 9.0 work in Unity.\n\nHowever, the `LangVersion` in the generated csproj file is fixed at 9.0, causing IDEs to display compilation errors and making features beyond C# 9.0 unavailable. Csproj LangVersion Processor resolves this issue by automatically rewriting the `LangVersion` in the generated csproj file.\n\n\u003e [!WARNING]\n\u003e As there haven't been runtime updates, not all language features may be available. Also, please note that this method is not endorsed by Unity, so there's no guarantee of functionality.\n\n## Setup\n\n### Requirements\n\n* Unity 2022.2 or later (Unity 2022.3.12f1 or later is recommended)\n\n### Installation\n\n1. Open Package Manager from Window \u003e Package Manager.\n2. Click on the \"+\" button \u003e Add package from git URL.\n3. Enter the following URL:\n\n```\nhttps://github.com/AnnulusGames/CsprojLangVersionProcessor.git?path=Assets/CsprojLangVersionProcessor\n```\n\nAlternatively, open Packages/manifest.json and add the following to the dependencies block:\n\n```json\n{\n    \"dependencies\": {\n        \"com.annulusgames.csproj-langversion-processor\": \"https://github.com/AnnulusGames/CsprojLangVersionProcessor.git?path=Assets/CsprojLangVersionProcessor\"\n    }\n}\n```\n\n## Usage\n\nOpen ProjectSettings \u003e Player \u003e Other Settings \u003e Script Compilation and add the following to Additional Compiler Arguments (you can also specify options other than preview. If you wish to use C#11.0 equivalent features in versions from Unity 2022.3.12f1 or later, specify preview):\n\n```\n-langVersion:preview\n```\n\n\u003cimg src=\"https://github.com/AnnulusGames/CsprojLangVersionProcessor/blob/main/docs/images/img1.png\" width=\"500\"\u003e\n\nNext, open ProjectSettings \u003e Editor \u003e Csproj LangVersion Processor and specify the LangVersion to be used in the IDE.\n\n\u003cimg src=\"https://github.com/AnnulusGames/CsprojLangVersionProcessor/blob/main/docs/images/img2.png\" width=\"500\"\u003e\n\nWith this setup, when adding a cs file, the csproj will be automatically updated. However, manual updating is also possible via Edit \u003e Preferences \u003e External Tools \u003e Regenerate project files.\n\n\u003cimg src=\"https://github.com/AnnulusGames/CsprojLangVersionProcessor/blob/main/docs/images/img3.png\" width=\"500\"\u003e\n\n## Limitations\n\nCsproj LangVersion Processor is a library designed for easy override of the LangVersion property and does not support modifications to other properties or specifying target assemblies. (All csproj files included in the project are affected.)\n\nFor more functionalities, it's recommended to use [Cysharp/CsprojModifier](https://github.com/Cysharp/CsprojModifier).\n\n## License\n\n[MIT License](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannulusgames%2Fcsprojlangversionprocessor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fannulusgames%2Fcsprojlangversionprocessor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannulusgames%2Fcsprojlangversionprocessor/lists"}