简体   繁体   English

Linux或Windows是否同时支持旧版和当前的dotnet核心版本?

[英]Both legacy and current dotnet core version support on Linux or Windows?

I have two dotnet core projects. 我有两个dotnet核心项目。 One of them uses dotnet 1.0 ( Preview 2 build 3131 and 3133 ) and other uses dotnet 1.1.1 . 其中一个使用dotnet 1.0预览版2内部版本3131和3133 ),另一个使用dotnet 1.1.1 As far as I know, I cannot run a project.json & xproj based projects with dotnet 1.1.1 and I also cannot run csproj based projects with dotnet 1.0. 据我所知,我无法使用dotnet 1.1.1运行基于project.json & xproj的项目,也无法使用dotnet 1.0运行基于csproj的项目。

I can migrate the legacy dotnet core project to csproj. 我可以将旧式dotnet核心项目迁移到csproj。 But I am looking for a solution that I can work on both projects in Windows or Linux. 但是我正在寻找一种可以在Windows或Linux上的两个项目中使用的解决方案。

I checked using docker when compiling projects in Visual Studio and could not find any sufficient resource. 我在Visual Studio中编译项目时使用docker检查,找不到任何足够的资源。

Thanks. 谢谢。

The csproj based tooling works with both .NET Core 1.0 and 1.1 . 基于csproj的工具可与.NET Core 1.01.1 There also is a tooling preview2 (project.json/xproj) build that has .NET Core 1.1 support ( 1.0.0-preview2-1-003177 ). 还有一个具有.NET Core 1.1支持( 1.0.0-preview2-1-003177 )的工具Preview2(project.json / xproj)构建。

The point is that the versioning of the tools is independent of the the version of the .net core runtime at the moment, though the upcoming 2.0 releases will be csproj only, with both runtime and tooling having a 2.0 version. 关键是,这些工具的版本控制目前与.net核心运行时的版本无关,尽管即将发布的2.0版本仅是csproj,运行时和工具均具有2.0版本。

First, you seem to be confusing the version of .Net Core, with the version of .Net Core SDK. 首先,您似乎将.Net Core版本与.Net Core SDK版本混淆了。

The version of .Net Core (eg 1.0.4 or 1.1.1) is not directly related the the difference between project.json and csproj. .Net Core的版本(例如1.0.4或1.1.1)与project.json和csproj之间的区别没有直接关系。 That is the version of the runtime itself. 那是运行时本身的版本。 You can easily switch between different versions of .Net Core on the same machine, just by editing your project file. 您只需编辑项目文件,即可轻松地在同一台计算机上的.Net Core的不同版本之间切换。

The version of .Net Core SDK (eg Preview 2 build 3131 or 1.0.3) is what decides what project format you can use. .Net Core SDK的版本(例如Preview 2 build 3131或1.0.3)决定了可以使用的项目格式。 SDK Preview 2 only supports project.json, SDK 1.0.x only supports csproj. SDK Preview 2仅支持project.json,SDK 1.0.x仅支持csproj。 You can have multiple versions of SDK installed on the same machine, and thus have support for both project formats at the same time. 您可以在同一台计算机上安装多个版本的SDK,因此可以同时支持两种项目格式。 But if you want to do that, you need to specify the version of SDK for each project using global.json . 但是,如果要这样做,则需要使用global.json为每个项目指定SDK的版本。

As for Visual Studio, VS 2015 only supports project.json and VS 2017 only supports csproj (but should be able to migrate project.json projects). 对于Visual Studio,VS 2015仅支持project.json,而VS 2017仅支持csproj(但应能够迁移project.json项目)。

That being said, I don't see any reason why you should keep using project.json, .Net Core SDK 1.0.x, which supports csproj, works fine on both Linux and Windows. 话虽如此,我看不出您为什么要继续使用project.json的任何原因,支持csproj的.Net Core SDK 1.0.x在Linux和Windows上均能正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM