Core: error: Project <name> does not have a lock file

Created on 19 May 2016  路  4Comments  路  Source: dotnet/core

I am new to the .NET core and working on the TodoApi tutorial but in the middle i found the error that "project TodoApi does not have a lock file". Anyone help me to resolve this.

Most helpful comment

run dotnet restore on your project.

All 4 comments

run dotnet restore on your project.

In my case that makes no difference whatsoever

C:\Users\Bruce\Desktop>md test

C:\Users\Bruce\Desktop>cd test

C:\Users\Bruce\Desktop\test>dotnet new
Created new C# project in C:\Users\Bruce\Desktop\test.

C:\Users\Bruce\Desktop\test>dir
 Volume in drive C is TI10665200H
 Volume Serial Number is 384F-4E8A

 Directory of C:\Users\Bruce\Desktop\test

25/06/2016  11:27 PM    <DIR>          .
25/06/2016  11:27 PM    <DIR>          ..
25/06/2016  11:27 PM               214 Program.cs
25/06/2016  11:27 PM               302 project.json
               2 File(s)            516 bytes
               2 Dir(s)  425,735,077,888 bytes free

C:\Users\Bruce\Desktop\test>dotnet run
Project test does not have a lock file.
Project test does not have a lock file.

C:\Users\Bruce\Desktop\test>dotnet restore
log  : Restoring packages for C:\Users\Bruce\Desktop\test\project.json...
error: Failed to retrieve information from remote source 'C:\Users\Bruce\Documents\Projects\Work\Resources\packages'.

C:\Users\Bruce\Desktop\test>dotnet --info
.NET Command Line Tools (1.0.0-preview1-002702)

Product Information:
 Version:     1.0.0-preview1-002702
 Commit Sha:  6cde21225e

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

And the project.json says

{
  "version": "1.0.0-*",
  "buildOptions": {
    "emitEntryPoint": true
  },
  "dependencies": {
    "Microsoft.NETCore.App": {
      "type": "platform",
      "version": "1.0.0-rc2-3002702"
    }
  },
  "frameworks": {
    "netcoreapp1.0": {
      "imports": "dnxcore50"
    }
  }
}

Not happy

@axtens I think that means you have the directory C:\Users\Bruce\Documents\Projects\Work\Resources\packages configured as package source in your C:\Users\Bruce\AppData\Roaming\NuGet\NuGet.Config, but that directory does not exist.

Either remove or disable that source (by manually editing NuGet.Config or from VS) or create that directory.

@livarcocc I think the error message should be describe solution (explicit or with link)

"project TodoApi does not have a lock file. Please run "dotnet restore" or see http://link-to.solution"

Need to google it to find the right solution :smile:

Was this page helpful?
0 / 5 - 0 ratings