dotnet-installer/src/Microsoft.DotNet.Cli.Sln.Internal/LocalizableStrings.cs
Mikkel Nylander Bundgaard 80b293d4a6 Correct parsing of 'Format Version' header in sln files
Prior to this change the exception on line 138 could not
be thrown, as far as I can tell. The reason for this
is that`HeaderPrefix` contained a trailing space, and we
had verified that `line` (trimmed) started with
`HeaderPrefix`. Hence `line` must contain something more
than `HeaderPrefix` otherwise the tailing space would
have been removed, so the length of `line` could not be
less than or equal to the length of `HeaderPrefix`.

Added and changed tests to ensure that both exceptions
regarding `FormatVersion` are thrown.

Fixes #5978
2017-05-14 20:53:34 +02:00

32 lines
1.4 KiB
C#

// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.DotNet.Cli.Sln.Internal
{
internal class LocalizableStrings
{
// {0} is the line number
// {1} is the error message details
public const string ErrorMessageFormatString = "Invalid format in line {0}: {1}";
public const string ProjectParsingErrorFormatString = "Project section is missing '{0}' when parsing the line starting at position {1}";
public const string InvalidPropertySetFormatString = "Property set is missing '{0}'";
public const string GlobalSectionMoreThanOnceError = "Global section specified more than once";
public const string GlobalSectionNotClosedError = "Global section not closed";
public const string FileHeaderMissingVersionError = "File header is missing version";
public const string FileHeaderMissingError = "Expected file header not found";
public const string ProjectSectionNotClosedError = "Project section not closed";
public const string InvalidSectionTypeError = "Invalid section type: {0}";
public const string SectionIdMissingError = "Section id missing";
public const string ClosingSectionTagNotFoundError = "Closing section tag not found";
}
}