[.NET Core 24]把project.json迁移到.csproj
链接: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, this is what it looks like:
首先,微软大大简化.csproj格式。最小的格式,如下:
<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:
其次,project.json 的优点都移植到了新的csproj格式:
支持通配符(如果一个文件被添加到项目文件,没有更多的合并冲突)。
命令行工具如dotnet.exe可以跟他们一起工作。
Multi-targeting很简单:只需指定目标框架(target frameworks),就可以了。
包引用和项目引用很容易添加。
从项目中构建包也更容易(see full reference)。
迁移:
Let’s look at how we can move from project.json
(and the old .xproj
) to the new and shiny. Before starting, make sure that the required toolsets are installed. On Windows, you currently need a Visual Studio 2017 install (we’re working on that). On Mac OS / Linux, the Mono tooling is required.
$ dotnet --info
.NET Command Line Tools (1.0.0-preview2-003121) Product Information:
Version: 1.0.0-preview2-003121
Commit SHA-1 hash: 1e9d529bc5 Runtime Environment:
OS Name: Mac OS X
OS Version: 10.10
OS Platform: Darwin
RID: osx.10.10-x64
执行命令出现错误
$ dotnet migrate
No 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 change the SDK version to 1.1.0. The dotnet migrate
command requires .NET Core CLI RC3 or higher.
qiongyanzhudeMacBook-Pro:BeibeiBasic qiongyanzhu$ dotnet migrate Project 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).
Summary
Total Projects: 12
Succeeded Projects: 12
Failed Projects: 0 The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help.
Files backed up to /Users/qiongyanzhu/RiderProjects/BeibeiBasic/backup/
qiongyanzhudeMacBook-Pro:BeibeiBasic qiongyanzhu$
Once finished, existing project.json
and .xproj
will be converted to .csproj
. Depending on the project type, Rider will automatically reload the solution after migration completes (worst case, you may have to close and re-open Rider).
Further details on migrating projects from project.json
to .csproj
can be found on Microsoft’s documentation site:
[.NET Core 24]把project.json迁移到.csproj的更多相关文章
- .NET Core项目从xproj+project.json向csproj迁移简介
3月7日,微软发布了Visual Studio 2017 RTM,与之一起发布的还有.NET Core Runtime 1.1.0以及.NET Core SDK 1.0.0,尽管这些并不是最新版,但也 ...
- .NET Core 构建配置文件从 project.json 到 .csproj
从 .NET Core SDK 1.0 Preview 3 build 004056 开始,.NET Core 弃用 project.json,回归 .csproj,主要原因是为了兼容 MSBuild ...
- [.NET Core 32]升级vs code之后,vs code无法调试net core web项目
错误提示&处理方法 参考链接:https://github.com/OmniSharp/omnisharp-vscode/issues/1742 错误:The .NET Core debugg ...
- Ubuntu-Docker[1]安装Docker,通过Docker部署net core代码,需要结合[.NET Core 18]发布、ASP.NET Core Docker部署
1)通过系统自带包安装 通过自带包安装,可能Docker版本较旧 $ sudo apt-get update Reading package lists... Done $ sudo apt-get ...
- .NET Core系列 : 2 、project.json 这葫芦里卖的什么药
.NET Core系列 : 1..NET Core 环境搭建和命令行CLI入门 介绍了.NET Core环境,本文介绍.NET Core中最重要的一个配置文件project.json的相关内容.我们可 ...
- [asp.net core]project.json(1)
摘要 前面介绍了使用vs2015新建asp.net core web的内容,这篇文章学习下project.json文件的内容. project.json 原文:https://docs.microso ...
- .NET Core 工具从 project.json 移动到基于 MSBuild 的项目后的使用
.NET Core 从preview 4 开始弃用project.json 可以从这下载最新版本: https://github.com/dotnet/cli 使用VS2017 RC新建.net co ...
- ASP.NET Core project.json imports 是什么意思?
示例代码: "frameworks": { "netcoreapp1.0.0": { "imports" : "portable- ...
- ASP.NET Core中的project.json何去何从?
Shawn Wildermuth (https://wildermuth.com/2016/05/12/The-Future-of-project-json-in-ASP-NET-Core) If y ...
随机推荐
- 洛谷 P1724 东风谷早苗
P1724 东风谷早苗 题目描述 在幻想乡,东风谷早苗是以高达控闻名的高中生宅巫女.某一天,早苗终于入手了最新款的钢达姆模型.作为最新的钢达姆,当然有了与以往不同的功能了,那就是它能够自动行走,厉害吧 ...
- CF #261 div2 D. Pashmak and Parmida's problem (树状数组版)
Parmida is a clever girl and she wants to participate in Olympiads this year. Of course she wants he ...
- phoenixframe自己主动化平台在Linux环境下运行用例的说明
phoenixframe自己主动化平台支持在Linux环境下使用phantomjs,Firefox.chrome运行測试用例.但有下面几个问题须要注意: 1.若无法启动phantomjs,Firefo ...
- 3lession-python编程规范
今天继续学习python,内容主要就是python编程过程中的一些规范,包括注释.换行等 1.注释 所有的注释都是以#开头,注释可以单独占有一行,也可以放到语句的末尾.因为python没有多行注释,所 ...
- 【习题 6-1 UVA-673】Parentheses Balance
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 括号匹配. 栈模拟就好. 多种括号也是一样可以做的. [代码] #include <bits/stdc++.h> usi ...
- Java Web学习总结(12)——使用Session防止表单重复提交
在平时开发中,如果网速比较慢的情况下,用户提交表单后,发现服务器半天都没有响应,那么用户可能会以为是自己没有提交表单,就会再点击提交按钮重复提交表单,我们在开发中必须防止表单重复提交. 一.表单重复提 ...
- js进阶 13-8 jquery如何实现侧边栏
js进阶 13-8 jquery如何实现侧边栏 一.总结 一句话总结:先是把侧边栏设置为left为-100px,隐藏起来,jquery自定义动画animate里面的改变元素的距左边的宽度left,sl ...
- Maven使用yuicompressor-maven-plugin打包压缩css、js文件
最近项目想使用在maven打包的时间压缩js,css文件,采用yuicompressor-maven-plugin插件进行压缩,但只是压缩减小大小,提高请求速度,并没有对js进行混淆.下面就写一下这个 ...
- 基于StringUtils工具类的常用方法介绍(必看篇)
前言:工作中看到项目组里的大牛写代码大量的用到了StringUtils工具类来做字符串的操作,便学习整理了一下,方便查阅. isEmpty(String str) 是否为空,空格字符为false is ...
- CloudFoundry hm9000原理及排错
hm9000跟hm_next(healthmanager)功能类似.在cloudfoundry集群中担任至关重要的角色 - 尝试启动缺失情况下的实例,停止异常实例 - 获知和报告应用执行的实际实例个数 ...