默认ASP.NET核心项目无法发布 [英] Default ASP.NET core project failing to publish

查看:69
本文介绍了默认ASP.NET核心项目无法发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作我的第一个.net核心应用程序。我只是在Visual Studio模板中创建了默认的asp.net核心网络应用,然后尝试 dotnet发布,但出现此错误:

I am making my first .net core app. I just created the default asp.net core web app inside visual studio template and then tried dotnet publish but I get this error:

PM> dotnet publish
dotnet : 'D:\Projects\coreTest\CoreTest' does not contain a project.json file
At line:1 char:1
+ dotnet publish
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: ('D:\Projects\co...oject.json file:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

我没有做任何更改。默认模板包括一个 project.json 文件,其中列出了相关性。为什么不希望发布?

I haven't changed anything. The default template includes a project.json file with dependencies listed. Why doesn't it want to publish?

推荐答案

对于遇到此问题并最终得到此答案的任何人,您在尝试编译的其他计算机上的 dotnet --version 之间不匹配。

For anyone running into this and ending up on this answer, it is possible that you have a mismatch between dotnet --version on different machines where you are trying to compile.

有一个从过渡到突破性变化 project.json 回到MS Build。

There is a breaking change in transitioning from project.json back to MS Build.

我试图在Windows上编译为MS Build版本构建的应用程序具有 project.json 版本的环境,并遇到了这个环境。作为新手,当涉及到新的.NET内容时,并且没有紧跟更改,我有一段时间没有意识到这是罪魁祸首。

I was trying to compile an app built for the MS Build version on an environment with the project.json version and ran into this. As a noob when it comes to new .NET stuff, and having not followed the changes too closely, I didn't realize this was the culprit for some time.

这篇关于默认ASP.NET核心项目无法发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆