Add 'dotnet restore' instruction when lock file is missing
This commit is contained in:
parent
4711f5983f
commit
81e9b2fe10
2 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue