[.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:
最新文章
- The current identity (NT AUTHORITY/NETWORK SERVICE)
- U-Boot Driver Model领域模型设计
- Fragment与ViewPager
- Core文件作用、设置及用法
- Linux_CentOS6.5安装vncserver实现图形化访问
- jQuery - 设置内容和属性
- IE浏览器部分版本不支持opacity透明度属性问题
- Android BaseAdapter ListView (明星简介列表)
- CSS 样式属性锦集
- Android系统移植(一)-让android系统在目标平台上运行起来
- c++ 智能指针【转载】
- selenium headlesschrome下设置最大窗口模式
- JS实现键盘监听
- UNIX环境高级编程——select和epoll的区别
- ios WKWebView 与 JS 交互实战技巧
- $A,B$ 实对称 $\ra\tr((AB)^2)\leq \tr(A^2B^2)$
- ubuntu Error fetching https://gems.ruby-china.org/: 	Errno::ECONNREFUSED: Connection refused
- Markdown编辑器开发记录(一):开发的初衷和初期踩的坑
- ubuntu下如何编译C语言
- pyV8不支持dom操作,关于PyV8的支持DOM的疑问
热门文章
- maven的pom.xml配置文件讲解
- 洛谷 P1211 [USACO1.3]牛式 Prime Cryptarithm
- 基于AndFix的热修复 成功后简单的总结总结错失
- Hadoop读书笔记(一)Hadoop介绍
- 嵌入式Linux学习笔记 NAND Flash控制器
- python打印即时输出的方法
- 移动端 h5 开发相关内容总结——JavaScript 篇
- [Angular2 Form] Validation message for Reactive form
- 数学之路-python计算实战(5)-初识numpy以及pypy下执行numpy
- Win10安装后必做的优化,解决磁盘100%占用