[. NET Core 24] migrating project.json to. csproj

Source: Internet
Author: User
Tags dotnet net command net command line

Links: https://blog.jetbrains.com/dotnet/2017/04/04/rider-eap-update-csproj-based-net-core-support-migrate/

How to migrate from the (deprecated) project.json format to the new .csproj format.

First, Microsoft greatly simplified the .csproj format. In minimal format, the What's it looks like:

First, Microsoft greatly simplifies the. csproj format. The smallest format, as follows:

<project sdk= "MICROSOFT.NET.SDK" >   <PropertyGroup>    <TargetFramework>netstandard1.4< /targetframework>  </PropertyGroup> </Project>

Second, the good things of project.json were ported over to the new .csproj format:

Second, the advantages of Project.json are ported to the new csproj format:

Wildcard characters are supported (if a file is added to the project file, there are no more merge conflicts).
command-line tools such as Dotnet.exe can work with them.
The multi-targeting is simple: just specify the target frame (destination frameworks) and you can.
Package references and project references are easy to add.
It is also easier to build packages from projects (see full reference).

Migration:

Let's look at what we can move from (and the old) to the project.json .xproj new and shiny. Before starting, make sure that the required toolsets is installed. On Windows, you currently need a Visual Studio install (we ' re working in that). On Mac Os/linux, the Mono tooling is required.

Qiongyanzhudemacbook-pro:beibeicore.services qiongyanzhu$ dotnet--info.net Command line Tools (1.0.0-preview2-003121 ) Product information:version:            1.0.0-preview2-003121 Commit SHA-1 hash:  1e9d529bc5runtime environment:os Name :     Mac os X os Version:  10.10 OS platform:darwin RID:         osx.10.10-x64

An error occurred executing the command

Iongyanzhudemacbook-pro:beibeibasic qiongyanzhu$ dotnet migrateno executable found matching command "Dotnet-migrate"

Note: If you get an error "No executable found matching command dotnet-migrate", edit the solution ' s global.json file and Cha Nge the SDK version to 1.1.0. The dotnet migrate command requires. NET Core CLI RC3 or higher.

Qiongyanzhudemacbook-pro:beibeibasic qiongyanzhu$ dotnet Migrateproject beibeiweb.flowuitest Migration succeeded (/ Users/qiongyanzhu/riderprojects/beibeibasic/beibeiweb.flowuitest). Project Beibeiweb.flowui Migration succeeded (/users/qiongyanzhu/riderprojects/beibeibasic/beibeiweb.flowui). Project beibeicore.services Migration succeeded (/users/qiongyanzhu/riderprojects/beibeibasic/beibeicore.services) . Project beibeicore.utility Migration succeeded (/users/qiongyanzhu/riderprojects/beibeibasic/beibeicore.utility). Project BeibeiCore.EF.Test Migration succeeded (/users/qiongyanzhu/riderprojects/beibeibasic/beibeicore.ef.test). Project Beibeicore.ef Migration succeeded (/USERS/QIONGYANZHU/RIDERPROJECTS/BEIBEIBASIC/BEIBEICORE.EF). Project BeibeiCore.Domain.P2P Migration succeeded (/users/qiongyanzhu/riderprojects/beibeibasic/ BeibeiCore.Domain.P2P). Project BeibeiCore.Component.IData Migration succeeded (/users/qiongyanzhu/riderprojects/beibeibasic/ BeibeiCore.Component.IData). Project Beibeicore. Ado. Flow Migration succeeded (/users/qiongyanzhu/riderprojects/beibeibasic/beibeicore.ado.flow). Project Beibeibasic.web Migration succeeded (/users/qiongyanzhu/riderprojects/beibeibasic/beibeibasic.web). Project beibeibasic.services Migration succeeded (/users/qiongyanzhu/riderprojects/beibeibasic/ beibeibasic.services). Project Beibeibasic.models Migration succeeded (/users/qiongyanzhu/riderprojects/beibeibasic/beibeibasic.models). Summarytotal projects:12succeeded projects:12failed projects:0the Project migration has finished. Please visit https://aka.ms/coremigration to the report no issues you ' ve encountered or ask for help. Files backed up To/users/qiongyanzhu/riderprojects/beibeibasic/backup/qiongyanzhudemacbook-pro:beibeibasic qiongyanzhu$

Once finished, existing and'll be project.json .xproj converted to .csproj . Depending on the project type, Rider'll automatically reload the solution after migration completes (worst case, your may Has to close and re-open Rider).

Further details on migrating projects from project.json to .csproj can is found on Microsoft ' s documentation site:

    • migrating. NET Core projects to the .csproj format
    • The dotnet migrate command line tool

[. NET Core 24] migrating project.json to. csproj

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.