[英]ASP.NET Core 1.1 can't Publish App
I'm trying to run a simple dotnet publish
command so I can compile my web application on my linux server. 我正在尝试运行一个简单的dotnet publish
命令,以便我可以在我的linux服务器上编译我的Web应用程序。 It tells me that my project.json
is missing. 它告诉我,我的project.json
丢失了。
Before you answer, there have been some recent changes below you should consider. 在你回答之前,你应该考虑下面的一些最近的变化。 Correct me if I'm wrong but I don't need project.json
because my web application is a higher version that doesn't require it: 如果我错了,请纠正我,但我不需要project.json
因为我的Web应用程序是一个不需要它的更高版本:
I'm currently running on ASP.NET Core 1.1 and .NET Core 1.1. 我目前正在运行ASP.NET Core 1.1和.NET Core 1.1。 As I am aware in November 2016 they depreciated
project.json
in favor ofproject.csproj
so projects created in Visual Studio 2017 will no longer generate this file any longer. 正如我在2016年11月所知,他们将project.json
弃用为project.csproj
因此在Visual Studio 2017中创建的项目将不再生成此文件。
ASP.NET Core 1.0 usesproject.json
ASP.NET Core 1.0使用project.json
ASP.NET Core 1.1 usesproject.csproj
ASP.NET Core 1.1使用project.csproj
How I created my web application project: 我如何创建我的Web应用程序项目:
I only displayed how I created my project because it shows people I don't need to
dotnet migrate
into 1.1 since the project never begun as a 1.0 project 我只展示了我创建项目的方式,因为它显示了我不需要将dotnet migrate
到1.1的人,因为项目从未作为1.0项目开始
Locally my project runs fine, it restores
, it publishes
it runs
. 在本地我的项目运行良好,它restores
,它publishes
它runs
。 It does all the fun things dotnet
commands should do perfectly fine. 它完成了所有有趣的事情, dotnet
命令应该做得非常好。
The more specific question : 更具体的问题 :
On a linux server with the latest dotnet --version
running dotnet publish
gives me the error saying project.json
is required. 在具有最新dotnet --version
的linux服务器上dotnet --version
运行dotnet publish
给出了错误,说明需要project.json
。 Why does the latest version of .NET Core (1.1) require project.json
when clearly its depreciated in version 1.1 and should be looking for .csproj
instead? 为什么最新版本的.NET Core(1.1)需要project.json
当它在版本1.1中明显折旧并且应该寻找.csproj
?
While we're in this crossover period where project.json
is being replaced by .csproj
, there are two versions of the SDK. 当我们处于这个交叉时期,其中project.json
被.csproj
替换时,SDK有两个版本。 There is still a version of the SDK based around project.json
for v1.1, and you must have that installed on your linux server. 对于v1.1,仍然有一个基于project.json
的SDK版本,你必须在linux服务器上安装它。
This mess should be going away very soon (with the release of VS2017 in roughly a week's time) when the tooling goes to RTM. 当工具进入RTM时,这个混乱应该很快消失(在大约一个星期的时间内释放VS2017)。 From that point onwards everything will be .csproj
based and project.json
is fully deprecated. 从那时起,所有内容都将基于.csproj
而project.json
则完全弃用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.