question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trying to run preview 3 commands on project.json projects could give clearer error

See original GitHub issue

Steps to reproduce

  1. Create a project.json-based project.
  2. Run a preview 3 command like dotnet restore, dotnet build or dotnet run on it.

Expected behavior

Clear error message explaining that the project is not compatible and suggesting dotnet migrate.

Actual behavior

>dotnet restore
MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.

>dotnet build
Microsoft (R) Build Engine version 15.1.0.0
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.

>dotnet run
Couldn't find a project to run. Ensure a project exists in E:\Users\Svick\git\core\samples\helloworld.
Or pass the path to the project using --project

This is confusing to users that don’t know the difference between the various Preview versions or about the switch from project.json to msbuild, for example: https://github.com/dotnet/core/issues/363.

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview3-004056)

Product Information:
 Version:            1.0.0-preview3-004056
 Commit SHA-1 hash:  ccc4968bc3

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x64

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
vcsjonescommented, Nov 29, 2016

+1.

I would propose:

  1. If there is no csproj / sln, and there is a project.json or global.json, then print out a message about “dotnet migrate”
  2. If there is no project.json, then the existing message is probably fine.
  3. If there is a csproj and a project.json, the tooling should be happy to use whatever it wants to so users can have SxS tooling for a project, if they want.
0reactions
livarcocccommented, Jan 23, 2017

This seems like a duplicate of https://github.com/dotnet/cli/issues/4628.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sample projects no longer build · Issue #363 · dotnet/core
The sample projects use project.json. It looks like you're on SDK preview3 (or newer), which switched to msbuild. To build and run those ......
Read more >
Getting Error "Your project must have an Android package ...
I get the following error,. Your project must have an Android package set in app.json. So I looked at expos tutorial page and...
Read more >
Getting "Error detecting project version" when project is run ...
I have created a process. It works when I run it. I published that project, run it in the UiPath Robot and it...
Read more >
Error: SFDX Deploy source to org
So i went to the package.xml file and right click > SFDX:Retreive Source in Manifest from org and it worked. Then you can...
Read more >
R.I.P project.json - Out with the new, in with the old
The tooling to work with ASP.NET Core was in an early preview and at the time we had DNVM and DNU commands. These...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found