{"id":30441743,"url":"https://github.com/abock/bxc57840-repro-case","last_synced_at":"2026-07-06T14:31:14.045Z","repository":{"id":66650540,"uuid":"95693723","full_name":"abock/bxc57840-repro-case","owner":"abock","description":"Repro test case for Visual Studio for Mac bug #57840","archived":false,"fork":false,"pushed_at":"2017-06-28T17:18:26.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-03T23:47:34.082Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-06-28T17:18:06.000Z","updated_at":"2017-06-28T17:18:27.000Z","dependencies_parsed_at":"2023-07-08T13:31:00.187Z","dependency_job_id":null,"html_url":"https://github.com/abock/bxc57840-repro-case","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abock/bxc57840-repro-case","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abock%2Fbxc57840-repro-case","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abock%2Fbxc57840-repro-case/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abock%2Fbxc57840-repro-case/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abock%2Fbxc57840-repro-case/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abock","download_url":"https://codeload.github.com/abock/bxc57840-repro-case/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abock%2Fbxc57840-repro-case/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35195590,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-06T02:00:07.184Z","response_time":106,"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":[],"created_at":"2025-08-23T07:11:09.701Z","updated_at":"2026-07-06T14:31:13.736Z","avatar_url":"https://github.com/abock.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Repro test case for Visual Studio for Mac bug [#57840][bug]\n\n## Summary\n\nThis is a very severe and easily reproducible bug in Visual Studio for Mac\nVersion 7.1 Preview (7.1 build 1178). It resulted in VS for Mac reformatting\nhundreds of source code files on disk without asking.\n\nWe have an existing PCL project, and I wanted to create a .NET Standard project\nalongside it. When the .NET Standard project was added to the same directory\nas the PCL project, all files (not just source code) were included in the .NET\nStandard project. This is not itself much off a problem, except that the process\nof adding these files to the project appears to ***open, reformat, and rewrite\nto disk every single file***.\n\n### There are two core issues here:\n\n1. *none* of our source code should be opened and reformatted at all during\n   the project creation process; this is just bad dangerous behavior, and also\n   drastically slows down the project creation operation\n\n2. The new project is following the default code formatting policy, and not\n   the policy set on the solution, which in our case, is \"Mono\"\n\n## Repro Steps\n\n1. Create a new \"Portable\" library project and solution. Name the solution\n  \"PortableAndNetStandard\" and the project \"Portable\".\n\n2. Configure the solution's C# formatting policy to be \"Mono\" (e.g. 8-width\n   tabs instead of 4-space \"tabs\").\n\n3. Reformat \"MyClass.cs\" (_Edit → Format → Format Document_) so that it follows\n   the \"Mono\" policy.\n\n4. Add some more C# files to the project and notice they are in the \"Mono\"\n   format.\n\n5. Commit everything so far to a fresh git repository.\n\n6. Create a new .NET Standard Library project (targeting 2.0 in my case) in the\n   solution and name the project \"NetStandard\". The project creation wizard\n   will note that the directory still exists, which is okay (and desired),\n   so continue by answering \"Yes\".\n\n7. Note that the \"NetStandard\" project now includes all files in the directory\n   structure already (e.g. from the creation of our \"Portable\" project).\n\n8. **The bugs:** note that all of the _source code has been reformatted_ using\n   the default policy (not the \"Mono\" one configured for the solution).\n\n## Analysis\n\nRead each commit in this repository to see the effect of the bug on existing\nprojects. The addition of a new .NET Standard project to an existing solution\nand directory structure already populated with code results in the rewriting of\nevery file.\n\nVisual Studio should:\n\n1. not open and rewrite _any_ existing files when creating a new project, ever\n2. should always apply the solution level policy when formatting _at the\n   appropriate time_ (e.g. when requested by the user).\n\n[bug]: https://bugzilla.xamarin.com/show_bug.cgi?id=57840","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabock%2Fbxc57840-repro-case","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabock%2Fbxc57840-repro-case","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabock%2Fbxc57840-repro-case/lists"}