2

I made a change to a known working project and now I get the following when building with dotnet build:

λ dotnet build
Object reference not set to an instance of an object.

The change was adding a new framework to the frameworks section, which has worked in the past. I'm not sure why it suddenly stopped working.

1 Answer 1

3

This is a known bug in the dotnet CLI. It happens if you add a new framework to project.json but don't run dotnet restore.

Restoring first fixes the issue:

λ dotnet restore

log  : Restore completed in 2138ms.

λ dotnet build

Compilation succeeded.
    0 Warning(s)
    0 Error(s)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.