默认ASP.NET核心项目无法发布

编程入门 行业动态 更新时间:2024-10-26 18:29:26
本文介绍了默认ASP.NET核心项目无法发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

I am making my first core app. I just created the default asp 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核心项目无法发布

本文发布于:2023-11-11 08:06:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1577839.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:核心   项目   ASP   NET

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!