{"id":13458241,"url":"https://github.com/hvanbakel/CsprojToVs2017","last_synced_at":"2025-03-24T15:30:58.722Z","repository":{"id":21392729,"uuid":"92638262","full_name":"hvanbakel/CsprojToVs2017","owner":"hvanbakel","description":"Tooling for converting pre 2017 project to the new Visual Studio 2017 format.","archived":false,"fork":false,"pushed_at":"2024-01-01T16:24:38.000Z","size":923,"stargazers_count":1079,"open_issues_count":48,"forks_count":120,"subscribers_count":33,"default_branch":"master","last_synced_at":"2024-10-29T17:55:45.862Z","etag":null,"topics":["conversion","csproj","csproj-tooling","migrate","migration","visual-studio-2017"],"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/hvanbakel.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}},"created_at":"2017-05-28T03:44:03.000Z","updated_at":"2024-10-22T06:11:09.000Z","dependencies_parsed_at":"2024-01-13T17:47:25.304Z","dependency_job_id":"62d043ab-abe8-45b6-83ef-f2021e71b80b","html_url":"https://github.com/hvanbakel/CsprojToVs2017","commit_stats":{"total_commits":382,"total_committers":28,"mean_commits":"13.642857142857142","dds":0.5130890052356021,"last_synced_commit":"1c365b305fe7d576c86a0c208b18d8012263b3a7"},"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hvanbakel%2FCsprojToVs2017","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hvanbakel%2FCsprojToVs2017/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hvanbakel%2FCsprojToVs2017/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hvanbakel%2FCsprojToVs2017/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hvanbakel","download_url":"https://codeload.github.com/hvanbakel/CsprojToVs2017/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245104524,"owners_count":20561379,"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":["conversion","csproj","csproj-tooling","migrate","migration","visual-studio-2017"],"created_at":"2024-07-31T09:00:48.209Z","updated_at":"2025-03-24T15:30:58.677Z","avatar_url":"https://github.com/hvanbakel.png","language":"C#","funding_links":[],"categories":["C\\#","others","C#"],"sub_categories":[],"readme":"[![Build status](https://ci.appveyor.com/api/projects/status/bpo5n2yehpqrxbc4?svg=true)](https://ci.appveyor.com/project/hvanbakel/csprojtovs2017)\n[![NuGet Version](https://img.shields.io/nuget/v/Project2015To2017.svg?label=Nupkg%20Version)](https://www.nuget.org/packages/Project2015To2017)\n[![NuGet Downloads](https://img.shields.io/nuget/dt/Project2015To2017.svg?label=Nupkg%20Downloads)](https://www.nuget.org/packages/Project2015To2017)\n[![VS15 Global Tool NuGet Version](https://img.shields.io/nuget/v/Project2015To2017.Migrate2017.Tool.svg?label=Global%20Tool%20Version)](https://www.nuget.org/packages/Project2015To2017.Migrate2017.Tool)\n[![VS15 Global Tool NuGet Downloads](https://img.shields.io/nuget/dt/Project2015To2017.Migrate2017.Tool.svg?label=Global%20Tool%20Downloads)](https://www.nuget.org/packages/Project2015To2017.Migrate2017.Tool)\n[![VS16 Global Tool NuGet Version](https://img.shields.io/nuget/v/Project2015To2017.Migrate2019.Tool.svg?label=Global%20Tool%20Version)](https://www.nuget.org/packages/Project2015To2017.Migrate2019.Tool)\n[![VS16 Global Tool NuGet Downloads](https://img.shields.io/nuget/dt/Project2015To2017.Migrate2019.Tool.svg?label=Global%20Tool%20Downloads)](https://www.nuget.org/packages/Project2015To2017.Migrate2019.Tool)\n\n# Convert your old project files to the new 2017/2019 format\nWith the introduction of Visual Studio 2017, Microsoft added some optimizations to how a project file can be set up. However, no tooling was made available that performed this conversion as it was not necessary to do since Visual Studio 2017 would work with the old format too.\n\nThis project converts an existing csproj to the new format, shortening the project file and using all the nice new features that are part of modern Visual Studio versions.\n\n## What does it fix?\nThere are a number of things [that VS2017+ handles differently](http://www.natemcmaster.com/blog/2017/03/09/vs2015-to-vs2017-upgrade/) that are performed by this tool:\n1. Include files using a wildcard as opposed to specifying every single file\n2. A more succinct way of defining project references\n3. A more succinct way of handling NuGet package references\n4. Moving some of the attributes that used to be defined in AssemblyInfo.cs into the project file\n5. Defining the NuGet package definition as part of the project file\n\n## Quick Start\nAssuming you have .NET Core 2.1+ installed you can run this on the command line:\n```\n\u003e dotnet tool install --global Project2015To2017.Migrate2019.Tool\n```\n\nThis will install the tool for you to use it anywhere you would like. You can then call the tool as shown in the examples below.\n\n```\n\u003e dotnet migrate-2019 wizard \"D:\\Path\\To\\My\\TestProject.csproj\"\n```\n\nOr\n\n```\n\u003e dotnet migrate-2019 wizard \"D:\\Path\\To\\My\\TestProject.sln\"\n```\n\nOr\n\n```\n\u003e dotnet migrate-2019 wizard .\\MyProjectDirectory\n```\n\nOr even\n\n```\n\u003e dotnet migrate-2019 wizard **\\*\n```\n\nThis will start the interactive wizard, which will guide you through the conversion process.\nYou will have an option to create backups before all critical conversion stages.\n\n**Note:** There is no need to specify paths if there is only one convertible object (project or solution) in your current working directory.\nThe tool will discover them automatically, or inform you in case it can't make definite (and safest) decision.\n\n**Note:** in case you need to migrate to VS2017, not VS2019, install `Project2015To2017.Migrate2017.Tool` instead.\nIt will provide `dotnet migrate-2017` command with a few tiny behavioral differences to support older VS versions.\n\n## Commands\n* `wizard` will run interactive conversion wizard as shown above\n* `migrate` will run non-interactive migration (useful for scripts or advanced users)\n* `evaluate` will run evaluation of projects found given the path specified\n* `analyze` will run analyzers to signal issues in the project files without performing actual conversion\n\nMost likely the only command you would use is the `wizard`, since it will execute all others in a way to achieve best user experience.\n\n## Flags\n* `target-frameworks` will override the target framework on the outputted project file\n* `force-transformations` allows specifying individual transforms to be run on the projects\n* `force` ignores checks like project type being supported and will attempt a conversion regardless\n* `keep-assembly-info` instructs the migrate logic to keep the assembly info file\n* `old-output-path` will set `AppendTargetFrameworkToOutputPath` in converted project file\n* `no-backup` do not create a backup folder (e.g. when your solution is under source control)\n\nNot all flags are supported by all commands, verify help output of the command to learn which options apply to the particular command.\n\nIn case you need to specify multiple values for option, specify it multiple times:\n\n```\n\u003e dotnet migrate-2019 migrate -t net40 -t net45\n```\n\n## Use as a NuGet library from your own code\n\nFor additional control of the project migration process, you can use the NuGet packages directly from your code.\n\nAdd the `Project2015To2017.Migrate2019.Library` package to your project e.g.\n```\n\u003e dotnet add package Project2015To2017.Migrate2019.Library\n```\n\nThen, to apply the default project migration:\n\n```c#\nusing Project2015To2017;\nusing Project2015To2017.Analysis;\nusing Project2015To2017.Migrate2017;\nusing Project2015To2017.Migrate2019.Library;\nusing Project2015To2017.Writing;\n\n// We use Serilog, but you can use any logging provider\nusing Serilog;\nusing Serilog.Extensions.Logging;\n\nnamespace Acme.ProjectMigration\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            var logger = new LoggerConfiguration()\n                        .Enrich.FromLogContext()\n                        .MinimumLevel.Debug()\n                        .WriteTo.Console()\n                        .CreateLogger();\n\n            var genericLogger = new SerilogLoggerProvider(logger)\n                                .CreateLogger(nameof(Serilog));\n\n            var facility = new MigrationFacility(genericLogger);\n\n            facility.ExecuteMigrate(\n                new[] { @\"C:\\full-path-to-solution-or-project-file.sln\" },\n                Vs16TransformationSet.Instance, // the default set of project file transformations\n\n                // The rest are optional, will use sane defaults if not specified\n\n                new ConversionOptions(), // control over things like target framework and AssemblyInfo treatment\n                new ProjectWriteOptions(), // control over backup creation and custom source control logic\n                new AnalysisOptions() // control over diagnostics which will be run after migration\n            );\n        }\n    }\n}\n```\n\nTo provide a custom set of project transforms, provide these to the `ExecuteMigrate` function call:\n\n```c#\nvar customTransforms = new BasicTransformationSet(\n    // Note that these should implement ITransformationWithTargetMoment\n    // in order to make sure that they run before or after\n    // the majority of standard transforms.\n\n    // You can also implement ITransformationWithDependencies to ensure\n    // that your transformation always runs after some other\n    // standard or user-specified transformations.\n\n    new MyCustomPreTransform1(),\n    new MyCustomPreTransform2(),\n    new MyCustomPostTransform1(),\n    new MyCustomPostTransform2()\n);\n\n// Mix transformations from Vs16TransformationSet and from customTransforms.\n// The correct order will be resolved by the library based on\n// dependency graph topological ordering within each execution moment\n// (early, normal, late).\nvar resultTransforms = new ChainTransformationSet(\n    Vs16TransformationSet.Instance,\n    customTransforms\n);\n\nfacility.ExecuteMigrate(\n    new[] { @\"C:\\full-path-to-solution-or-project-file.sln\" },\n    resultTransforms\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhvanbakel%2FCsprojToVs2017","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhvanbakel%2FCsprojToVs2017","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhvanbakel%2FCsprojToVs2017/lists"}