Add 'dotnet restore' instruction when lock file is missing

This commit is contained in:
Erik Schierboom 2016-05-20 09:19:05 +02:00
parent 4711f5983f
commit 81e9b2fe10
2 changed files with 2 additions and 1 deletions

View file

@ -104,7 +104,7 @@ namespace Microsoft.DotNet.Tools.Build
{
if (project.LockFile == null)
{
var errorMessage = $"Project {project.ProjectName()} does not have a lock file.";
var errorMessage = $"Project {project.ProjectName()} does not have a lock file. Please run \"dotnet restore\" to generate a new lock file.";
Reporter.Error.WriteLine(errorMessage);
throw new InvalidOperationException(errorMessage);
}

View file

@ -79,6 +79,7 @@ namespace Microsoft.DotNet.Tools.Builder.Tests
buildResult = BuildProject(expectBuildFailure: true);
Assert.Contains("does not have a lock file", buildResult.StdErr);
Assert.Contains("dotnet restore", buildResult.StdErr);
}
[Fact]