Reputation: 14846
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
I haven't changed anything. The default template includes a project.json
file with dependencies listed. Why doesn't it want to publish?
Upvotes: 3
Views: 2100
Reputation: 10577
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.
There is a breaking change in transitioning from project.json
back to MS Build.
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.
Upvotes: 1
Reputation: 14846
This seems to be a bug with package manager. I managed to publish the project by right clicking the project and selecting publish.
Upvotes: 1