Fixed a few issues with lock file check
- Normalize version for comparison - Change dnu restore to dotnet restore in error message
This commit is contained in:
parent
8ebc1bf9f5
commit
b334c8f28c
2 changed files with 4 additions and 4 deletions
|
@ -98,7 +98,7 @@ namespace Microsoft.Extensions.ProjectModel.Graph
|
|||
if (range.MinVersion == range.MaxVersion &&
|
||||
(range.Float == null || range.Float.FloatBehavior == NuGetVersionFloatBehavior.None))
|
||||
{
|
||||
return range.MinVersion.ToString();
|
||||
return range.MinVersion.ToNormalizedString();
|
||||
}
|
||||
var sb = new StringBuilder();
|
||||
sb.Append(">= ");
|
||||
|
@ -106,7 +106,7 @@ namespace Microsoft.Extensions.ProjectModel.Graph
|
|||
{
|
||||
case null:
|
||||
case NuGetVersionFloatBehavior.None:
|
||||
sb.Append(range.MinVersion);
|
||||
sb.Append(range.MinVersion.ToNormalizedString());
|
||||
break;
|
||||
case NuGetVersionFloatBehavior.Prerelease:
|
||||
// Work around nuget bug: https://github.com/NuGet/Home/issues/1598
|
||||
|
|
|
@ -157,7 +157,7 @@ namespace Microsoft.Extensions.ProjectModel
|
|||
{
|
||||
diagnostics.Add(new DiagnosticMessage(
|
||||
ErrorCodes.NU1009,
|
||||
$"The expected lock file doesn't exist. Please run \"dnu restore\" to generate a new lock file.",
|
||||
$"The expected lock file doesn't exist. Please run \"dotnet restore\" to generate a new lock file.",
|
||||
Path.Combine(Project.ProjectDirectory, LockFile.FileName),
|
||||
DiagnosticMessageSeverity.Error));
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ namespace Microsoft.Extensions.ProjectModel
|
|||
{
|
||||
diagnostics.Add(new DiagnosticMessage(
|
||||
ErrorCodes.NU1006,
|
||||
$"{lockFileValidationMessage}. Please run \"dnu restore\" to generate a new lock file.",
|
||||
$"{lockFileValidationMessage}. Please run \"dotnet restore\" to generate a new lock file.",
|
||||
Path.Combine(Project.ProjectDirectory, LockFile.FileName),
|
||||
DiagnosticMessageSeverity.Warning));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue