All Projects → hvanbakel → Csprojtovs2017

hvanbakel / Csprojtovs2017

Licence: mit
Tooling for converting pre 2017 project to the new Visual Studio 2017 format.

Projects that are alternatives of or similar to Csprojtovs2017

Oas Kit
Convert Swagger 2.0 definitions to OpenAPI 3.0 and resolve/validate/lint
Stars: ✭ 516 (-41.1%)
Mutual labels:  conversion
Docconv
Converts PDF, DOC, DOCX, XML, HTML, RTF, etc to plain text
Stars: ✭ 735 (-16.1%)
Mutual labels:  conversion
Experdb Db2pg
eXperDB-DB2PG is a data migration solution that transfers data extracted from various DBMSs to eXperDB or PostgreSQL. Currently, Oracle and Oracle Spatial, MySQL, SQL Server(MS-SQL) and Sybase data can be transferred.
Stars: ✭ 24 (-97.26%)
Mutual labels:  migration
Alfred Convert
Convert between different units in Alfred
Stars: ✭ 560 (-36.07%)
Mutual labels:  conversion
Tslint To Eslint Config
Converts your TSLint configuration to the closest possible ESLint equivalent. 🚀
Stars: ✭ 680 (-22.37%)
Mutual labels:  conversion
Migrate
Database migrations. CLI and Golang library.
Stars: ✭ 7,712 (+780.37%)
Mutual labels:  migration
Altium2kicad
Altium to KiCad converter for PCB and schematics
Stars: ✭ 490 (-44.06%)
Mutual labels:  conversion
Node Pg Migrate
Node.js database migration management for Postgresql
Stars: ✭ 838 (-4.34%)
Mutual labels:  migration
Vim Pandoc
pandoc integration and utilities for vim
Stars: ✭ 734 (-16.21%)
Mutual labels:  conversion
Press Sync
The easiest way to synchronize posts, media, users and more between two WordPress sites.
Stars: ✭ 22 (-97.49%)
Mutual labels:  migration
Node Sqlite
SQLite client for Node.js applications with SQL-based migrations API written in Typescript
Stars: ✭ 642 (-26.71%)
Mutual labels:  migration
Structured Text Tools
A list of command line tools for manipulating structured text data
Stars: ✭ 6,180 (+605.48%)
Mutual labels:  conversion
Simple Java Mail
Simple API, Complex Emails (JavaMail smtp wrapper)
Stars: ✭ 821 (-6.28%)
Mutual labels:  conversion
Rxjava2 Android Samples
RxJava 2 Android Examples - Migration From RxJava 1 to RxJava 2 - How to use RxJava 2 in Android
Stars: ✭ 4,950 (+465.07%)
Mutual labels:  migration
Migrify
Futuristic Grinder for Legacy Code with Effortles Confidence
Stars: ✭ 25 (-97.15%)
Mutual labels:  migration
Gocqlx
All-In-One: CQL query builder, ORM and migration tool
Stars: ✭ 512 (-41.55%)
Mutual labels:  migration
Metapensiero.pj
Javascript for refined palates: a Python 3 to ES6 Javascript translator
Stars: ✭ 752 (-14.16%)
Mutual labels:  conversion
Convertpcltocore
17 Steps to Convert your PCL to .NET Standard
Stars: ✭ 10 (-98.86%)
Mutual labels:  conversion
Laminas Zendframework Bridge
Alias legacy ZF class names to Laminas Project equivalents.
Stars: ✭ 928 (+5.94%)
Mutual labels:  migration
Unicopy
Unicode command-line codepoint dumper
Stars: ✭ 16 (-98.17%)
Mutual labels:  conversion

Build status NuGet Version NuGet Downloads VS15 Global Tool NuGet Version VS15 Global Tool NuGet Downloads VS16 Global Tool NuGet Version VS16 Global Tool NuGet Downloads

Convert your old project files to the new 2017/2019 format

With 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.

This 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.

What does it fix?

There are a number of things that VS2017+ handles differently that are performed by this tool:

  1. Include files using a wildcard as opposed to specifying every single file
  2. A more succinct way of defining project references
  3. A more succinct way of handling NuGet package references
  4. Moving some of the attributes that used to be defined in AssemblyInfo.cs into the project file
  5. Defining the NuGet package definition as part of the project file

Quick Start

Assuming you have .NET Core 2.1+ installed you can run this on the command line:

> dotnet tool install --global Project2015To2017.Migrate2019.Tool

This 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.

> dotnet migrate-2019 wizard "D:\Path\To\My\TestProject.csproj"

Or

> dotnet migrate-2019 wizard "D:\Path\To\My\TestProject.sln"

Or

> dotnet migrate-2019 wizard .\MyProjectDirectory

Or even

> dotnet migrate-2019 wizard **\*

This will start the interactive wizard, which will guide you through the conversion process. You will have an option to create backups before all critical conversion stages.

Note: There is no need to specify paths if there is only one convertible object (project or solution) in your current working directory. The tool will discover them automatically, or inform you in case it can't make definite (and safest) decision.

Note: in case you need to migrate to VS2017, not VS2019, install Project2015To2017.Migrate2017.Tool instead. It will provide dotnet migrate-2017 command with a few tiny behavioral differences to support older VS versions.

Commands

  • wizard will run interactive conversion wizard as shown above
  • migrate will run non-interactive migration (useful for scripts or advanced users)
  • evaluate will run evaluation of projects found given the path specified
  • analyze will run analyzers to signal issues in the project files without performing actual conversion

Most likely the only command you would use is the wizard, since it will execute all others in a way to achieve best user experience.

Flags

  • target-frameworks will override the target framework on the outputted project file
  • force-transformations allows specifying individual transforms to be run on the projects
  • force ignores checks like project type being supported and will attempt a conversion regardless
  • keep-assembly-info instructs the migrate logic to keep the assembly info file
  • old-output-path will set AppendTargetFrameworkToOutputPath in converted project file
  • no-backup do not create a backup folder (e.g. when your solution is under source control)

Not all flags are supported by all commands, verify help output of the command to learn which options apply to the particular command.

In case you need to specify multiple values for option, specify it multiple times:

> dotnet migrate-2019 migrate -t net40 -t net45

Use as a NuGet library from your own code

For additional control of the project migration process, you can use the NuGet packages directly from your code.

Add the Project2015To2017.Migrate2019.Library package to your project e.g.

> dotnet add package Project2015To2017.Migrate2019.Library

Then, to apply the default project migration:

using Project2015To2017;
using Project2015To2017.Analysis;
using Project2015To2017.Migrate2017;
using Project2015To2017.Migrate2019.Library;
using Project2015To2017.Writing;

// We use Serilog, but you can use any logging provider
using Serilog;
using Serilog.Extensions.Logging;

namespace Acme.ProjectMigration
{
    class Program
    {
        static void Main(string[] args)
        {
            var logger = new LoggerConfiguration()
                        .Enrich.FromLogContext()
                        .MinimumLevel.Debug()
                        .WriteTo.Console()
                        .CreateLogger();

            var genericLogger = new SerilogLoggerProvider(logger)
                                .CreateLogger(nameof(Serilog));

            var facility = new MigrationFacility(genericLogger);

            facility.ExecuteMigrate(
                new[] { @"C:\full-path-to-solution-or-project-file.sln" },
                Vs16TransformationSet.Instance, // the default set of project file transformations

                // The rest are optional, will use sane defaults if not specified

                new ConversionOptions(), // control over things like target framework and AssemblyInfo treatment
                new ProjectWriteOptions(), // control over backup creation and custom source control logic
                new AnalysisOptions() // control over diagnostics which will be run after migration
            );
        }
    }
}

To provide a custom set of project transforms, provide these to the ExecuteMigrate function call:

var customTransforms = new BasicTransformationSet(
    // Note that these should implement ITransformationWithTargetMoment
    // in order to make sure that they run before or after
    // the majority of standard transforms.

    // You can also implement ITransformationWithDependencies to ensure
    // that your transformation always runs after some other
    // standard or user-specified transformations.

    new MyCustomPreTransform1(),
    new MyCustomPreTransform2(),
    new MyCustomPostTransform1(),
    new MyCustomPostTransform2()
);

// Mix transformations from Vs16TransformationSet and from customTransforms.
// The correct order will be resolved by the library based on
// dependency graph topological ordering within each execution moment
// (early, normal, late).
var resultTransforms = new ChainTransformationSet(
    Vs16TransformationSet.Instance,
    customTransforms
);

facility.ExecuteMigrate(
    new[] { @"C:\full-path-to-solution-or-project-file.sln" },
    resultTransforms
);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].