我正在制作我的第一个核心应用程序。我只是在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核心项目无法发布
发布评论