diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/.editorconfig b/src/Cli/Microsoft.DotNet.FileBasedPrograms/.editorconfig
new file mode 100644
index 000000000000..4694508c4da5
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/.editorconfig
@@ -0,0 +1,6 @@
+[*.cs]
+
+# IDE0240: Remove redundant nullable directive
+# The directive needs to be included since all sources in a source package are considered generated code
+# when referenced from a project via package reference.
+dotnet_diagnostic.IDE0240.severity = none
\ No newline at end of file
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/ExternalHelpers.cs b/src/Cli/Microsoft.DotNet.FileBasedPrograms/ExternalHelpers.cs
new file mode 100644
index 000000000000..629e4901a7e0
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/ExternalHelpers.cs
@@ -0,0 +1,63 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+#nullable enable
+using System;
+using System.IO;
+
+namespace Microsoft.DotNet.FileBasedPrograms;
+
+///
+/// When targeting netstandard2.0, the user of the source package must "implement" certain methods by declaring members in this type.
+///
+partial class ExternalHelpers
+{
+ public static partial int CombineHashCodes(int value1, int value2);
+ public static partial string GetRelativePath(string relativeTo, string path);
+
+ public static partial bool IsPathFullyQualified(string path);
+
+#if NET
+ public static partial int CombineHashCodes(int value1, int value2)
+ => HashCode.Combine(value1, value2);
+
+ public static partial string GetRelativePath(string relativeTo, string path)
+ => Path.GetRelativePath(relativeTo, path);
+
+ public static partial bool IsPathFullyQualified(string path)
+ => Path.IsPathFullyQualified(path);
+
+#elif FILE_BASED_PROGRAMS_SOURCE_PACKAGE_BUILD
+ // This path should only be used when we are verifying that the source package itself builds under netstandard2.0.
+ public static partial int CombineHashCodes(int value1, int value2)
+ => throw new NotImplementedException();
+
+ public static partial string GetRelativePath(string relativeTo, string path)
+ => throw new NotImplementedException();
+
+ public static partial bool IsPathFullyQualified(string path)
+ => throw new NotImplementedException();
+
+#endif
+}
+
+#if FILE_BASED_PROGRAMS_SOURCE_PACKAGE_GRACEFUL_EXCEPTION
+internal class GracefulException : Exception
+{
+ public GracefulException()
+ {
+ }
+
+ public GracefulException(string? message) : base(message)
+ {
+ }
+
+ public GracefulException(string format, string arg) : this(string.Format(format, arg))
+ {
+ }
+
+ public GracefulException(string? message, Exception? innerException) : base(message, innerException)
+ {
+ }
+}
+#endif
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/FileBasedProgramsResources.resx b/src/Cli/Microsoft.DotNet.FileBasedPrograms/FileBasedProgramsResources.resx
new file mode 100644
index 000000000000..1161700f99d9
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/FileBasedProgramsResources.resx
@@ -0,0 +1,172 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Could not find any project in `{0}`.
+
+
+ Could not find project or directory `{0}`.
+
+
+ Found more than one project in `{0}`. Specify which one to use.
+
+
+ Invalid property name: {0}
+ {0} is an inner exception message.
+
+
+ The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
+ {Locked="#:property"}
+
+
+ Static graph restore is not supported for file-based apps. Remove the '#:property'.
+ {Locked="#:property"}
+
+
+ error
+ Used when reporting directive errors like "file(location): error: message".
+
+
+ The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
+ {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
+
+
+ Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
+ {Locked="--force"}
+
+
+ Duplicate directives are not supported: {0}
+ {0} is the directive type and name.
+
+
+ Directives currently cannot contain double quotes (").
+
+
+ The '#:project' directive is invalid: {0}
+ {0} is the inner error message.
+
+
+ Missing name of '{0}'.
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+ Unrecognized directive '{0}'.
+ {0} is the directive name like 'package' or 'sdk'.
+
+
\ No newline at end of file
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/FileLevelDirectiveHelpers.cs b/src/Cli/Microsoft.DotNet.FileBasedPrograms/FileLevelDirectiveHelpers.cs
new file mode 100644
index 000000000000..91292654793d
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/FileLevelDirectiveHelpers.cs
@@ -0,0 +1,621 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+#nullable enable
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Text.Json.Serialization;
+using System.Text.RegularExpressions;
+using System.Xml;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+
+#if !FILE_BASED_PROGRAMS_SOURCE_PACKAGE_GRACEFUL_EXCEPTION
+using Microsoft.DotNet.Cli.Utils;
+#endif
+
+namespace Microsoft.DotNet.FileBasedPrograms;
+
+internal static class FileLevelDirectiveHelpers
+{
+ public static SyntaxTokenParser CreateTokenizer(SourceText text)
+ {
+ return SyntaxFactory.CreateTokenParser(text,
+ CSharpParseOptions.Default.WithFeatures([new("FileBasedProgram", "true")]));
+ }
+
+ ///
+ /// If , the whole is parsed to find diagnostics about every app directive.
+ /// Otherwise, only directives up to the first C# token is checked.
+ /// The former is useful for dotnet project convert where we want to report all errors because it would be difficult to fix them up after the conversion.
+ /// The latter is useful for dotnet run file.cs where if there are app directives after the first token,
+ /// compiler reports anyway, so we speed up success scenarios by not parsing the whole file up front in the SDK CLI.
+ ///
+ public static ImmutableArray FindDirectives(SourceFile sourceFile, bool reportAllErrors, DiagnosticBag diagnostics)
+ {
+ var builder = ImmutableArray.CreateBuilder();
+ var tokenizer = CreateTokenizer(sourceFile.Text);
+
+ var result = tokenizer.ParseLeadingTrivia();
+ var triviaList = result.Token.LeadingTrivia;
+
+ FindLeadingDirectives(sourceFile, triviaList, diagnostics, builder);
+
+ // In conversion mode, we want to report errors for any invalid directives in the rest of the file
+ // so users don't end up with invalid directives in the converted project.
+ if (reportAllErrors)
+ {
+ tokenizer.ResetTo(result);
+
+ do
+ {
+ result = tokenizer.ParseNextToken();
+
+ foreach (var trivia in result.Token.LeadingTrivia)
+ {
+ ReportErrorFor(trivia);
+ }
+
+ foreach (var trivia in result.Token.TrailingTrivia)
+ {
+ ReportErrorFor(trivia);
+ }
+ }
+ while (!result.Token.IsKind(SyntaxKind.EndOfFileToken));
+ }
+
+ void ReportErrorFor(SyntaxTrivia trivia)
+ {
+ if (trivia.ContainsDiagnostics && trivia.IsKind(SyntaxKind.IgnoredDirectiveTrivia))
+ {
+ diagnostics.AddError(sourceFile, trivia.Span, FileBasedProgramsResources.CannotConvertDirective);
+ }
+ }
+
+ // The result should be ordered by source location, RemoveDirectivesFromFile depends on that.
+ return builder.ToImmutable();
+ }
+
+ /// Finds file-level directives in the leading trivia list of a compilation unit and reports diagnostics on them.
+ /// The builder to store the parsed directives in, or null if the parsed directives are not needed.
+ public static void FindLeadingDirectives(
+ SourceFile sourceFile,
+ SyntaxTriviaList triviaList,
+ DiagnosticBag diagnostics,
+ ImmutableArray.Builder? builder)
+ {
+ Debug.Assert(triviaList.Span.Start == 0);
+
+ var deduplicated = new Dictionary(NamedDirectiveComparer.Instance);
+ TextSpan previousWhiteSpaceSpan = default;
+
+ for (var index = 0; index < triviaList.Count; index++)
+ {
+ var trivia = triviaList[index];
+ // Stop when the trivia contains an error (e.g., because it's after #if).
+ if (trivia.ContainsDiagnostics)
+ {
+ break;
+ }
+
+ if (trivia.IsKind(SyntaxKind.WhitespaceTrivia))
+ {
+ Debug.Assert(previousWhiteSpaceSpan.IsEmpty);
+ previousWhiteSpaceSpan = trivia.FullSpan;
+ continue;
+ }
+
+ if (trivia.IsKind(SyntaxKind.ShebangDirectiveTrivia))
+ {
+ TextSpan span = GetFullSpan(previousWhiteSpaceSpan, trivia);
+
+ var whiteSpace = GetWhiteSpaceInfo(triviaList, index);
+ var info = new CSharpDirective.ParseInfo
+ {
+ Span = span,
+ LeadingWhiteSpace = whiteSpace.Leading,
+ TrailingWhiteSpace = whiteSpace.Trailing,
+ };
+ builder?.Add(new CSharpDirective.Shebang(info));
+ }
+ else if (trivia.IsKind(SyntaxKind.IgnoredDirectiveTrivia))
+ {
+ TextSpan span = GetFullSpan(previousWhiteSpaceSpan, trivia);
+
+ var message = trivia.GetStructure() is IgnoredDirectiveTriviaSyntax { Content: { RawKind: (int)SyntaxKind.StringLiteralToken } content }
+ ? content.Text.AsSpan().Trim()
+ : "";
+ var parts = Patterns.Whitespace.Split(message.ToString(), 2);
+ var name = parts.Length > 0 ? parts[0] : "";
+ var value = parts.Length > 1 ? parts[1] : "";
+ Debug.Assert(!(parts.Length > 2));
+
+ var whiteSpace = GetWhiteSpaceInfo(triviaList, index);
+ var context = new CSharpDirective.ParseContext
+ {
+ Info = new()
+ {
+ Span = span,
+ LeadingWhiteSpace = whiteSpace.Leading,
+ TrailingWhiteSpace = whiteSpace.Trailing,
+ },
+ Diagnostics = diagnostics,
+ SourceFile = sourceFile,
+ DirectiveKind = name,
+ DirectiveText = value,
+ };
+
+ // Block quotes now so we can later support quoted values without a breaking change. https://github.com/dotnet/sdk/issues/49367
+ if (value.Contains('"'))
+ {
+ diagnostics.AddError(sourceFile, context.Info.Span, FileBasedProgramsResources.QuoteInDirective);
+ }
+
+ if (CSharpDirective.Parse(context) is { } directive)
+ {
+ // If the directive is already present, report an error.
+ if (deduplicated.ContainsKey(directive))
+ {
+ var existingDirective = deduplicated[directive];
+ var typeAndName = $"#:{existingDirective.GetType().Name.ToLowerInvariant()} {existingDirective.Name}";
+ diagnostics.AddError(sourceFile, directive.Info.Span, string.Format(FileBasedProgramsResources.DuplicateDirective, typeAndName));
+ }
+ else
+ {
+ deduplicated.Add(directive, directive);
+ }
+
+ builder?.Add(directive);
+ }
+ }
+
+ previousWhiteSpaceSpan = default;
+ }
+
+ return;
+
+ static TextSpan GetFullSpan(TextSpan previousWhiteSpaceSpan, SyntaxTrivia trivia)
+ {
+ // Include the preceding whitespace in the span, i.e., span will be the whole line.
+ return previousWhiteSpaceSpan.IsEmpty ? trivia.FullSpan : TextSpan.FromBounds(previousWhiteSpaceSpan.Start, trivia.FullSpan.End);
+ }
+
+ static (WhiteSpaceInfo Leading, WhiteSpaceInfo Trailing) GetWhiteSpaceInfo(in SyntaxTriviaList triviaList, int index)
+ {
+ (WhiteSpaceInfo Leading, WhiteSpaceInfo Trailing) result = default;
+
+ for (int i = index - 1; i >= 0; i--)
+ {
+ if (!Fill(ref result.Leading, triviaList, i)) break;
+ }
+
+ for (int i = index + 1; i < triviaList.Count; i++)
+ {
+ if (!Fill(ref result.Trailing, triviaList, i)) break;
+ }
+
+ return result;
+
+ static bool Fill(ref WhiteSpaceInfo info, in SyntaxTriviaList triviaList, int index)
+ {
+ var trivia = triviaList[index];
+ if (trivia.IsKind(SyntaxKind.EndOfLineTrivia))
+ {
+ info.LineBreaks += 1;
+ info.TotalLength += trivia.FullSpan.Length;
+ return true;
+ }
+
+ if (trivia.IsKind(SyntaxKind.WhitespaceTrivia))
+ {
+ info.TotalLength += trivia.FullSpan.Length;
+ return true;
+ }
+
+ return false;
+ }
+ }
+ }
+}
+
+internal readonly record struct SourceFile(string Path, SourceText Text)
+{
+ public static SourceFile Load(string filePath)
+ {
+ using var stream = File.OpenRead(filePath);
+ return new SourceFile(filePath, SourceText.From(stream, Encoding.UTF8));
+ }
+
+ public SourceFile WithText(SourceText newText)
+ {
+ return new SourceFile(Path, newText);
+ }
+
+ public void Save()
+ {
+ using var stream = File.Open(Path, FileMode.Create, FileAccess.Write);
+ using var writer = new StreamWriter(stream, Encoding.UTF8);
+ Text.Write(writer);
+ }
+
+ public FileLinePositionSpan GetFileLinePositionSpan(TextSpan span)
+ {
+ return new FileLinePositionSpan(Path, Text.Lines.GetLinePositionSpan(span));
+ }
+
+ public string GetLocationString(TextSpan span)
+ {
+ var positionSpan = GetFileLinePositionSpan(span);
+ return $"{positionSpan.Path}({positionSpan.StartLinePosition.Line + 1})";
+ }
+}
+
+internal static partial class Patterns
+{
+ public static Regex Whitespace { get; } = new Regex("""\s+""", RegexOptions.Compiled);
+
+ public static Regex DisallowedNameCharacters { get; } = new Regex("""[\s@=/]""", RegexOptions.Compiled);
+
+ public static Regex EscapedCompilerOption { get; } = new Regex("""^/\w+:".*"$""", RegexOptions.Compiled | RegexOptions.Singleline);
+}
+
+internal struct WhiteSpaceInfo
+{
+ public int LineBreaks;
+ public int TotalLength;
+}
+
+///
+/// Represents a C# directive starting with #: (a.k.a., "file-level directive").
+/// Those are ignored by the language but recognized by us.
+///
+internal abstract class CSharpDirective(in CSharpDirective.ParseInfo info)
+{
+ public ParseInfo Info { get; } = info;
+
+ public readonly struct ParseInfo
+ {
+ ///
+ /// Span of the full line including the trailing line break.
+ ///
+ public required TextSpan Span { get; init; }
+ public required WhiteSpaceInfo LeadingWhiteSpace { get; init; }
+ public required WhiteSpaceInfo TrailingWhiteSpace { get; init; }
+ }
+
+ public readonly struct ParseContext
+ {
+ public required ParseInfo Info { get; init; }
+ public required DiagnosticBag Diagnostics { get; init; }
+ public required SourceFile SourceFile { get; init; }
+ public required string DirectiveKind { get; init; }
+ public required string DirectiveText { get; init; }
+ }
+
+ public static Named? Parse(in ParseContext context)
+ {
+ return context.DirectiveKind switch
+ {
+ "sdk" => Sdk.Parse(context),
+ "property" => Property.Parse(context),
+ "package" => Package.Parse(context),
+ "project" => Project.Parse(context),
+ var other => context.Diagnostics.AddError(context.SourceFile, context.Info.Span, string.Format(FileBasedProgramsResources.UnrecognizedDirective, other)),
+ };
+ }
+
+ private static (string, string?)? ParseOptionalTwoParts(in ParseContext context, char separator)
+ {
+ var separatorIndex = context.DirectiveText.IndexOf(separator);
+ var firstPart = (separatorIndex < 0 ? context.DirectiveText : context.DirectiveText.AsSpan(0, separatorIndex)).TrimEnd();
+
+ string directiveKind = context.DirectiveKind;
+ if (firstPart.IsWhiteSpace())
+ {
+ return context.Diagnostics.AddError<(string, string?)?>(context.SourceFile, context.Info.Span, string.Format(FileBasedProgramsResources.MissingDirectiveName, directiveKind));
+ }
+
+ // If the name contains characters that resemble separators, report an error to avoid any confusion.
+ if (Patterns.DisallowedNameCharacters.Match(context.DirectiveText, beginning: 0, length: firstPart.Length).Success)
+ {
+ return context.Diagnostics.AddError<(string, string?)?>(context.SourceFile, context.Info.Span, string.Format(FileBasedProgramsResources.InvalidDirectiveName, directiveKind, separator));
+ }
+
+ if (separatorIndex < 0)
+ {
+ return (firstPart.ToString(), null);
+ }
+
+ var secondPart = context.DirectiveText.AsSpan(separatorIndex + 1).TrimStart();
+ if (secondPart.IsWhiteSpace())
+ {
+ Debug.Assert(secondPart.Length == 0,
+ "We have trimmed the second part, so if it's white space, it should be actually empty.");
+
+ return (firstPart.ToString(), string.Empty);
+ }
+
+ return (firstPart.ToString(), secondPart.ToString());
+ }
+
+ public abstract override string ToString();
+
+ ///
+ /// #! directive.
+ ///
+ public sealed class Shebang(in ParseInfo info) : CSharpDirective(info)
+ {
+ public override string ToString() => "#!";
+ }
+
+ public abstract class Named(in ParseInfo info) : CSharpDirective(info)
+ {
+ public required string Name { get; init; }
+ }
+
+ ///
+ /// #:sdk directive.
+ ///
+ public sealed class Sdk(in ParseInfo info) : Named(info)
+ {
+ public string? Version { get; init; }
+
+ public static new Sdk? Parse(in ParseContext context)
+ {
+ if (ParseOptionalTwoParts(context, separator: '@') is not var (sdkName, sdkVersion))
+ {
+ return null;
+ }
+
+ return new Sdk(context.Info)
+ {
+ Name = sdkName,
+ Version = sdkVersion,
+ };
+ }
+
+ public override string ToString() => Version is null ? $"#:sdk {Name}" : $"#:sdk {Name}@{Version}";
+ }
+
+ ///
+ /// #:property directive.
+ ///
+ public sealed class Property(in ParseInfo info) : Named(info)
+ {
+ public required string Value { get; init; }
+
+ public static new Property? Parse(in ParseContext context)
+ {
+ if (ParseOptionalTwoParts(context, separator: '=') is not var (propertyName, propertyValue))
+ {
+ return null;
+ }
+
+ if (propertyValue is null)
+ {
+ return context.Diagnostics.AddError(context.SourceFile, context.Info.Span, FileBasedProgramsResources.PropertyDirectiveMissingParts);
+ }
+
+ try
+ {
+ propertyName = XmlConvert.VerifyName(propertyName);
+ }
+ catch (XmlException ex)
+ {
+ return context.Diagnostics.AddError(context.SourceFile, context.Info.Span, string.Format(FileBasedProgramsResources.PropertyDirectiveInvalidName, ex.Message), ex);
+ }
+
+ if (propertyName.Equals("RestoreUseStaticGraphEvaluation", StringComparison.OrdinalIgnoreCase) &&
+ MSBuildUtilities.ConvertStringToBool(propertyValue))
+ {
+ context.Diagnostics.AddError(context.SourceFile, context.Info.Span, FileBasedProgramsResources.StaticGraphRestoreNotSupported);
+ }
+
+ return new Property(context.Info)
+ {
+ Name = propertyName,
+ Value = propertyValue,
+ };
+ }
+
+ public override string ToString() => $"#:property {Name}={Value}";
+ }
+
+ ///
+ /// #:package directive.
+ ///
+ public sealed class Package(in ParseInfo info) : Named(info)
+ {
+ public string? Version { get; init; }
+
+ public static new Package? Parse(in ParseContext context)
+ {
+ if (ParseOptionalTwoParts(context, separator: '@') is not var (packageName, packageVersion))
+ {
+ return null;
+ }
+
+ return new Package(context.Info)
+ {
+ Name = packageName,
+ Version = packageVersion,
+ };
+ }
+
+ public override string ToString() => Version is null ? $"#:package {Name}" : $"#:package {Name}@{Version}";
+ }
+
+ ///
+ /// #:project directive.
+ ///
+ public sealed class Project(in ParseInfo info) : Named(info)
+ {
+ public static new Project? Parse(in ParseContext context)
+ {
+ var directiveText = context.DirectiveText;
+ if (directiveText.IsWhiteSpace())
+ {
+ string directiveKind = context.DirectiveKind;
+ return context.Diagnostics.AddError(context.SourceFile, context.Info.Span, string.Format(FileBasedProgramsResources.MissingDirectiveName, directiveKind));
+ }
+
+ try
+ {
+ // If the path is a directory like '../lib', transform it to a project file path like '../lib/lib.csproj'.
+ // Also normalize blackslashes to forward slashes to ensure the directive works on all platforms.
+ var sourceDirectory = Path.GetDirectoryName(context.SourceFile.Path) ?? ".";
+ var resolvedProjectPath = Path.Combine(sourceDirectory, directiveText.Replace('\\', '/'));
+ if (Directory.Exists(resolvedProjectPath))
+ {
+ var fullFilePath = GetProjectFileFromDirectory(resolvedProjectPath).FullName;
+
+ // Keep a relative path only if the original directive was a relative path.
+ directiveText = ExternalHelpers.IsPathFullyQualified(directiveText)
+ ? fullFilePath
+ : ExternalHelpers.GetRelativePath(relativeTo: sourceDirectory, fullFilePath);
+ }
+ else if (!File.Exists(resolvedProjectPath))
+ {
+ throw new GracefulException(FileBasedProgramsResources.CouldNotFindProjectOrDirectory, resolvedProjectPath);
+ }
+ }
+ catch (GracefulException e)
+ {
+ context.Diagnostics.AddError(context.SourceFile, context.Info.Span, string.Format(FileBasedProgramsResources.InvalidProjectDirective, e.Message), e);
+ }
+
+ return new Project(context.Info)
+ {
+ Name = directiveText,
+ };
+ }
+
+ public Project WithName(string name)
+ {
+ return new Project(Info) { Name = name };
+ }
+
+ public static FileInfo GetProjectFileFromDirectory(string projectDirectory)
+ {
+ DirectoryInfo dir;
+ try
+ {
+ dir = new DirectoryInfo(projectDirectory);
+ }
+ catch (ArgumentException)
+ {
+ throw new GracefulException(FileBasedProgramsResources.CouldNotFindProjectOrDirectory, projectDirectory);
+ }
+
+ if (!dir.Exists)
+ {
+ throw new GracefulException(FileBasedProgramsResources.CouldNotFindProjectOrDirectory, projectDirectory);
+ }
+
+ FileInfo[] files = dir.GetFiles("*proj");
+ if (files.Length == 0)
+ {
+ throw new GracefulException(
+ FileBasedProgramsResources.CouldNotFindAnyProjectInDirectory,
+ projectDirectory);
+ }
+
+ if (files.Length > 1)
+ {
+ throw new GracefulException(FileBasedProgramsResources.MoreThanOneProjectInDirectory, projectDirectory);
+ }
+
+ return files.First();
+ }
+
+ public override string ToString() => $"#:project {Name}";
+ }
+}
+
+///
+/// Used for deduplication - compares directives by their type and name (ignoring case).
+///
+internal sealed class NamedDirectiveComparer : IEqualityComparer
+{
+ public static readonly NamedDirectiveComparer Instance = new();
+
+ private NamedDirectiveComparer() { }
+
+ public bool Equals(CSharpDirective.Named? x, CSharpDirective.Named? y)
+ {
+ if (ReferenceEquals(x, y)) return true;
+
+ if (x is null || y is null) return false;
+
+ return x.GetType() == y.GetType() &&
+ StringComparer.OrdinalIgnoreCase.Equals(x.Name, y.Name);
+ }
+
+ public int GetHashCode(CSharpDirective.Named obj)
+ {
+ return ExternalHelpers.CombineHashCodes(
+ obj.GetType().GetHashCode(),
+ StringComparer.OrdinalIgnoreCase.GetHashCode(obj.Name));
+ }
+}
+
+internal sealed class SimpleDiagnostic
+{
+ public required Position Location { get; init; }
+ public required string Message { get; init; }
+
+ ///
+ /// An adapter of that ensures we JSON-serialize only the necessary fields.
+ ///
+ ///
+ /// note: this type is only serialized for run-api scenarios.
+ /// If/when run-api is removed, we would also want to remove the usage of System.Text.Json attributes.
+ ///
+ public readonly struct Position
+ {
+ public required string Path { get; init; }
+ public required LinePositionSpan Span { get; init; }
+ [JsonIgnore]
+ public TextSpan TextSpan { get; init; }
+ }
+}
+
+internal readonly struct DiagnosticBag
+{
+ public bool IgnoreDiagnostics { get; private init; }
+
+ ///
+ /// If and is , the first diagnostic is thrown as .
+ ///
+ public ImmutableArray.Builder? Builder { get; private init; }
+
+ public static DiagnosticBag ThrowOnFirst() => default;
+ public static DiagnosticBag Collect(out ImmutableArray.Builder builder) => new() { Builder = builder = ImmutableArray.CreateBuilder() };
+ public static DiagnosticBag Ignore() => new() { IgnoreDiagnostics = true, Builder = null };
+
+ public void AddError(SourceFile sourceFile, TextSpan textSpan, string message, Exception? inner = null)
+ {
+ if (Builder != null)
+ {
+ Debug.Assert(!IgnoreDiagnostics);
+ Builder.Add(new SimpleDiagnostic { Location = new SimpleDiagnostic.Position() { Path = sourceFile.Path, TextSpan = textSpan, Span = sourceFile.GetFileLinePositionSpan(textSpan).Span }, Message = message });
+ }
+ else if (!IgnoreDiagnostics)
+ {
+ throw new GracefulException($"{sourceFile.GetLocationString(textSpan)}: {FileBasedProgramsResources.DirectiveError}: {message}", inner);
+ }
+ }
+
+ public T? AddError(SourceFile sourceFile, TextSpan span, string message, Exception? inner = null)
+ {
+ AddError(sourceFile, span, message, inner);
+ return default;
+ }
+}
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/MSBuildUtilities.cs b/src/Cli/Microsoft.DotNet.FileBasedPrograms/MSBuildUtilities.cs
new file mode 100644
index 000000000000..17884509a0ab
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/MSBuildUtilities.cs
@@ -0,0 +1,72 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+// TODO: consider if this extra copy of the file can be avoided.
+// It's really not that much code, so, if we can't solve the reuse issue, we can live with that.
+#nullable enable
+using System;
+
+namespace Microsoft.DotNet.FileBasedPrograms
+{
+ ///
+ /// Internal utilities copied from microsoft/MSBuild repo.
+ ///
+ class MSBuildUtilities
+ {
+ ///
+ /// Converts a string to a bool. We consider "true/false", "on/off", and
+ /// "yes/no" to be valid boolean representations in the XML.
+ /// Modified from its original version to not throw, but return a default value.
+ ///
+ /// The string to convert.
+ /// Boolean true or false, corresponding to the string.
+ internal static bool ConvertStringToBool(string? parameterValue, bool defaultValue = false)
+ {
+ if (string.IsNullOrEmpty(parameterValue))
+ {
+ return defaultValue;
+ }
+ else if (ValidBooleanTrue(parameterValue))
+ {
+ return true;
+ }
+ else if (ValidBooleanFalse(parameterValue))
+ {
+ return false;
+ }
+ else
+ {
+ // Unsupported boolean representation.
+ return defaultValue;
+ }
+ }
+
+ ///
+ /// Returns true if the string represents a valid MSBuild boolean true value,
+ /// such as "on", "!false", "yes"
+ ///
+ private static bool ValidBooleanTrue(string? parameterValue)
+ {
+ return ((string.Compare(parameterValue, "true", StringComparison.OrdinalIgnoreCase) == 0) ||
+ (string.Compare(parameterValue, "on", StringComparison.OrdinalIgnoreCase) == 0) ||
+ (string.Compare(parameterValue, "yes", StringComparison.OrdinalIgnoreCase) == 0) ||
+ (string.Compare(parameterValue, "!false", StringComparison.OrdinalIgnoreCase) == 0) ||
+ (string.Compare(parameterValue, "!off", StringComparison.OrdinalIgnoreCase) == 0) ||
+ (string.Compare(parameterValue, "!no", StringComparison.OrdinalIgnoreCase) == 0));
+ }
+
+ ///
+ /// Returns true if the string represents a valid MSBuild boolean false value,
+ /// such as "!on" "off" "no" "!true"
+ ///
+ private static bool ValidBooleanFalse(string? parameterValue)
+ {
+ return ((string.Compare(parameterValue, "false", StringComparison.OrdinalIgnoreCase) == 0) ||
+ (string.Compare(parameterValue, "off", StringComparison.OrdinalIgnoreCase) == 0) ||
+ (string.Compare(parameterValue, "no", StringComparison.OrdinalIgnoreCase) == 0) ||
+ (string.Compare(parameterValue, "!true", StringComparison.OrdinalIgnoreCase) == 0) ||
+ (string.Compare(parameterValue, "!on", StringComparison.OrdinalIgnoreCase) == 0) ||
+ (string.Compare(parameterValue, "!yes", StringComparison.OrdinalIgnoreCase) == 0));
+ }
+ }
+}
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/Microsoft.DotNet.FileBasedPrograms.Package.csproj b/src/Cli/Microsoft.DotNet.FileBasedPrograms/Microsoft.DotNet.FileBasedPrograms.Package.csproj
new file mode 100644
index 000000000000..988130acf08e
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/Microsoft.DotNet.FileBasedPrograms.Package.csproj
@@ -0,0 +1,65 @@
+
+
+
+
+ $(VisualStudioServiceTargetFramework);netstandard2.0
+ false
+ none
+ false
+ preview
+
+
+ true
+ true
+ Microsoft.DotNet.FileBasedPrograms
+ false
+ Package containing sources for file-based programs support.
+
+ $(NoWarn);NU5128
+ false
+ $(DefineConstants);FILE_BASED_PROGRAMS_SOURCE_PACKAGE_BUILD;FILE_BASED_PROGRAMS_SOURCE_PACKAGE_GRACEFUL_EXCEPTION
+
+ disable
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ External\%(NuGetPackageId)\%(Link)
+
+
+
+
+
+
+
+
+ true
+ contentFiles\cs\any\FileBasedProgramsResources.resx
+
+
+ true
+ contentFiles\cs\any\xlf
+
+
+
+
+
+
+ <_PackageFiles Remove="@(_PackageFiles)" Condition="$([System.String]::Copy('%(_PackageFiles.Identity)').EndsWith('FileBasedProgramsResources.cs'))" />
+
+
+
+
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/Microsoft.DotNet.FileBasedPrograms.projitems b/src/Cli/Microsoft.DotNet.FileBasedPrograms/Microsoft.DotNet.FileBasedPrograms.projitems
new file mode 100644
index 000000000000..31ce6cd9eabc
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/Microsoft.DotNet.FileBasedPrograms.projitems
@@ -0,0 +1,15 @@
+
+
+
+ $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
+ true
+ 374C251E-BF99-45B2-A58E-40229ED8AACA
+
+
+ Microsoft.DotNet.FileBasedPrograms
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/Microsoft.DotNet.FileBasedPrograms.shproj b/src/Cli/Microsoft.DotNet.FileBasedPrograms/Microsoft.DotNet.FileBasedPrograms.shproj
new file mode 100644
index 000000000000..68cb2e509ef5
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/Microsoft.DotNet.FileBasedPrograms.shproj
@@ -0,0 +1,13 @@
+
+
+
+ 374C251E-BF99-45B2-A58E-40229ED8AACA
+ 14.0
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/README.md b/src/Cli/Microsoft.DotNet.FileBasedPrograms/README.md
new file mode 100644
index 000000000000..adfe2440e4e4
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/README.md
@@ -0,0 +1,16 @@
+# Microsoft.DotNet.FileBasedPrograms Source Package
+
+This is a source package containing shared code for [file-based programs](../../../documentation/general/dotnet-run-file.md) support. This package is intended only for internal use by .NET components.
+
+## Usage in Consuming Projects
+
+To use this package in your project, add the following to your `.csproj` file:
+
+```xml
+
+
+
+
+```
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.cs.xlf b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.cs.xlf
new file mode 100644
index 000000000000..d2dd3b59202f
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.cs.xlf
@@ -0,0 +1,77 @@
+
+
+
+
+
+ Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
+ Některé direktivy nelze převést. Spuštěním souboru zobrazíte všechny chyby kompilace. Zadejte „--force“, pokud chcete přesto provést převod.
+ {Locked="--force"}
+
+
+ Could not find any project in `{0}`.
+ V {0} se nenašel žádný projekt.
+
+
+
+ Could not find project or directory `{0}`.
+ Nenašel se projekt ani adresář {0}.
+
+
+
+ error
+ chyba
+ Used when reporting directive errors like "file(location): error: message".
+
+
+ Duplicate directives are not supported: {0}
+ Duplicitní direktivy nejsou podporovány: {0}
+ {0} is the directive type and name.
+
+
+ The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
+ Direktiva by měla obsahovat název bez speciálních znaků a volitelnou hodnotu oddělenou znakem {1}, například #:{0} Název{1}Hodnota.
+ {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
+
+
+ The '#:project' directive is invalid: {0}
+ Direktiva #:project je neplatná: {0}
+ {0} is the inner error message.
+
+
+ Missing name of '{0}'.
+ Chybí název pro: {0}.
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+ Found more than one project in `{0}`. Specify which one to use.
+ V {0} se našlo několik projektů. Vyberte, který z nich chcete použít.
+
+
+
+ Invalid property name: {0}
+ Neplatný název vlastnosti: {0}
+ {0} is an inner exception message.
+
+
+ The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
+ Direktiva property musí mít dvě části oddělené znakem =, například #:property PropertyName=PropertyValue.
+ {Locked="#:property"}
+
+
+ Directives currently cannot contain double quotes (").
+ Direktivy v současné době nemůžou obsahovat dvojité uvozovky (").
+
+
+
+ Static graph restore is not supported for file-based apps. Remove the '#:property'.
+ Statické obnovení grafu se pro souborové aplikace nepodporuje. Odeberte #:property.
+ {Locked="#:property"}
+
+
+ Unrecognized directive '{0}'.
+ Nerozpoznaná direktiva {0}.
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+
+
\ No newline at end of file
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.de.xlf b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.de.xlf
new file mode 100644
index 000000000000..13eb91fbaee3
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.de.xlf
@@ -0,0 +1,77 @@
+
+
+
+
+
+ Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
+ Einige Anweisungen können nicht konvertiert werden. Führen Sie die Datei aus, um alle Kompilierungsfehler anzuzeigen. Geben Sie „--force“ an, um das Umwandeln trotzdem auszuführen.
+ {Locked="--force"}
+
+
+ Could not find any project in `{0}`.
+ In "{0}" wurde kein Projekt gefunden.
+
+
+
+ Could not find project or directory `{0}`.
+ Das Projekt oder Verzeichnis "{0}" wurde nicht gefunden.
+
+
+
+ error
+ Fehler
+ Used when reporting directive errors like "file(location): error: message".
+
+
+ Duplicate directives are not supported: {0}
+ Doppelte Anweisungen werden nicht unterstützt: {0}
+ {0} is the directive type and name.
+
+
+ The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
+ Die Anweisung sollte einen Namen ohne Sonderzeichen und einen optionalen Wert enthalten, die durch „{1}“ getrennt sind, wie „#:{0} Name{1}Wert“.
+ {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
+
+
+ The '#:project' directive is invalid: {0}
+ Die Anweisung „#:p roject“ ist ungültig: {0}
+ {0} is the inner error message.
+
+
+ Missing name of '{0}'.
+ Fehlender Name der Anweisung „{0}“.
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+ Found more than one project in `{0}`. Specify which one to use.
+ In "{0}" wurden mehrere Projekte gefunden. Geben Sie an, welches davon verwendet werden soll.
+
+
+
+ Invalid property name: {0}
+ Ungültiger Eigenschaftenname: {0}
+ {0} is an inner exception message.
+
+
+ The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
+ Die Eigenschaftsanweisung muss zwei durch „=“ getrennte Teile aufweisen, z. B. „#:property PropertyName=PropertyValue“.
+ {Locked="#:property"}
+
+
+ Directives currently cannot contain double quotes (").
+ Direktiven dürfen derzeit keine doppelten Anführungszeichen (") enthalten.
+
+
+
+ Static graph restore is not supported for file-based apps. Remove the '#:property'.
+ Die Statische Graphwiederherstellung wird für dateibasierte Apps nicht unterstützt. Entfernen Sie '#:property'.
+ {Locked="#:property"}
+
+
+ Unrecognized directive '{0}'.
+ Unbekannte Anweisung „{0}“.
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+
+
\ No newline at end of file
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.es.xlf b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.es.xlf
new file mode 100644
index 000000000000..38d1daaa07ae
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.es.xlf
@@ -0,0 +1,77 @@
+
+
+
+
+
+ Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
+ Algunas directivas no se pueden convertir. Ejecute el archivo para ver todos los errores de compilación. Especifique "--force" para convertir de todos modos.
+ {Locked="--force"}
+
+
+ Could not find any project in `{0}`.
+ No se encuentra ningún proyecto en "{0}".
+
+
+
+ Could not find project or directory `{0}`.
+ No se encuentra el proyecto o directorio "{0}".
+
+
+
+ error
+ error
+ Used when reporting directive errors like "file(location): error: message".
+
+
+ Duplicate directives are not supported: {0}
+ No se admiten directivas duplicadas: {0}
+ {0} is the directive type and name.
+
+
+ The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
+ La directiva debe contener un nombre sin caracteres especiales y un valor opcional separado por "{1}" como "#:{0} Nombre{1}Valor".
+ {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
+
+
+ The '#:project' directive is invalid: {0}
+ La directiva "#:project" no es válida: {0}
+ {0} is the inner error message.
+
+
+ Missing name of '{0}'.
+ Falta el nombre de "{0}".
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+ Found more than one project in `{0}`. Specify which one to use.
+ Se han encontrado varios proyectos en "{0}". Especifique el que debe usarse.
+
+
+
+ Invalid property name: {0}
+ Nombre de propiedad no válido {0}
+ {0} is an inner exception message.
+
+
+ The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
+ La directiva de propiedad debe tener dos partes separadas por "=", como "#:property PropertyName=PropertyValue".
+ {Locked="#:property"}
+
+
+ Directives currently cannot contain double quotes (").
+ Las directivas no pueden contener comillas dobles ("), por ahora.
+
+
+
+ Static graph restore is not supported for file-based apps. Remove the '#:property'.
+ No se admite la restauración de gráficos estáticos para aplicaciones basadas en archivos. Elimine "#:property".
+ {Locked="#:property"}
+
+
+ Unrecognized directive '{0}'.
+ Directiva no reconocida "{0}".
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+
+
\ No newline at end of file
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.fr.xlf b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.fr.xlf
new file mode 100644
index 000000000000..e034912dd36e
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.fr.xlf
@@ -0,0 +1,77 @@
+
+
+
+
+
+ Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
+ Vous ne pouvez pas convertir certaines directives. Exécutez le fichier pour voir toutes les erreurs de compilation. Spécifiez « --force » pour convertir quand même.
+ {Locked="--force"}
+
+
+ Could not find any project in `{0}`.
+ Projet introuvable dans '{0}'.
+
+
+
+ Could not find project or directory `{0}`.
+ Projet ou répertoire '{0}' introuvable.
+
+
+
+ error
+ erreur
+ Used when reporting directive errors like "file(location): error: message".
+
+
+ Duplicate directives are not supported: {0}
+ Les directives dupliquées ne sont pas prises en charge : {0}
+ {0} is the directive type and name.
+
+
+ The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
+ La directive dans doit contenir un nom sans caractères spéciaux et une valeur facultative séparée par « {1} » comme « # :{0} Nom{1}Valeur ».
+ {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
+
+
+ The '#:project' directive is invalid: {0}
+ La directive « #:project » n’est pas valide : {0}
+ {0} is the inner error message.
+
+
+ Missing name of '{0}'.
+ Nom manquant pour « {0} ».
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+ Found more than one project in `{0}`. Specify which one to use.
+ Plusieurs projets dans '{0}'. Spécifiez celui à utiliser.
+
+
+
+ Invalid property name: {0}
+ Nom de propriété non valide : {0}
+ {0} is an inner exception message.
+
+
+ The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
+ La directive de propriété doit avoir deux parties séparées par '=' comme '#:property PropertyName=PropertyValue'.
+ {Locked="#:property"}
+
+
+ Directives currently cannot contain double quotes (").
+ Les directives ne peuvent actuellement pas contenir de guillemets doubles (").
+
+
+
+ Static graph restore is not supported for file-based apps. Remove the '#:property'.
+ La restauration de graphique statique n’est pas prise en charge pour les applications basées sur des fichiers. Supprimer la « #:property ».
+ {Locked="#:property"}
+
+
+ Unrecognized directive '{0}'.
+ Directive « {0} » non reconnue.
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+
+
\ No newline at end of file
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.it.xlf b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.it.xlf
new file mode 100644
index 000000000000..846df0ee663f
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.it.xlf
@@ -0,0 +1,77 @@
+
+
+
+
+
+ Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
+ Non è possibile convertire alcune direttive. Eseguire il file per visualizzare tutti gli errori di compilazione. Specificare '--force' per eseguire comunque la conversione.
+ {Locked="--force"}
+
+
+ Could not find any project in `{0}`.
+ Non è stato trovato alcun progetto in `{0}`.
+
+
+
+ Could not find project or directory `{0}`.
+ Non sono stati trovati progetti o directory `{0}`.
+
+
+
+ error
+ errore
+ Used when reporting directive errors like "file(location): error: message".
+
+
+ Duplicate directives are not supported: {0}
+ Le direttive duplicate non supportate: {0}
+ {0} is the directive type and name.
+
+
+ The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
+ La direttiva deve contenere un nome senza caratteri speciali e un valore facoltativo delimitato da '{1}' come '#:{0}Nome {1}Valore'.
+ {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
+
+
+ The '#:project' directive is invalid: {0}
+ La direttiva '#:project' non è valida: {0}
+ {0} is the inner error message.
+
+
+ Missing name of '{0}'.
+ Manca il nome di '{0}'.
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+ Found more than one project in `{0}`. Specify which one to use.
+ Sono stati trovati più progetti in `{0}`. Specificare quello da usare.
+
+
+
+ Invalid property name: {0}
+ Nome proprietà non valido: {0}
+ {0} is an inner exception message.
+
+
+ The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
+ La direttiva di proprietà deve avere due parti delimitate da '=', come '#:property PropertyName=PropertyValue'.
+ {Locked="#:property"}
+
+
+ Directives currently cannot contain double quotes (").
+ Le direttive attualmente non possono contenere virgolette doppie (").
+
+
+
+ Static graph restore is not supported for file-based apps. Remove the '#:property'.
+ Il ripristino statico del grafo non è supportato per le app basate su file. Rimuovere '#:property'.
+ {Locked="#:property"}
+
+
+ Unrecognized directive '{0}'.
+ Direttiva non riconosciuta '{0}'.
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+
+
\ No newline at end of file
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.ja.xlf b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.ja.xlf
new file mode 100644
index 000000000000..18e3732d59d1
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.ja.xlf
@@ -0,0 +1,77 @@
+
+
+
+
+
+ Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
+ 一部のディレクティブは変換できません。ファイルを実行して、すべてのコンパイル エラーを表示します。それでも変換する場合は '--force' を指定してください。
+ {Locked="--force"}
+
+
+ Could not find any project in `{0}`.
+ `{0}` にプロジェクトが見つかりませんでした。
+
+
+
+ Could not find project or directory `{0}`.
+ プロジェクトまたはディレクトリ `{0}` が見つかりませんでした。
+
+
+
+ error
+ エラー
+ Used when reporting directive errors like "file(location): error: message".
+
+
+ Duplicate directives are not supported: {0}
+ 重複するディレクティブはサポートされていません: {0}
+ {0} is the directive type and name.
+
+
+ The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
+ ディレクティブには、特殊文字を含まない名前と、'#:{0} Name{1}Value' などの '{1}' で区切られた省略可能な値を含める必要があります。
+ {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
+
+
+ The '#:project' directive is invalid: {0}
+ '#:p roject' ディレクティブが無効です: {0}
+ {0} is the inner error message.
+
+
+ Missing name of '{0}'.
+ '{0}' の名前がありません。
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+ Found more than one project in `{0}`. Specify which one to use.
+ `{0}` に複数のプロジェクトが見つかりました。使用するプロジェクトを指定してください。
+
+
+
+ Invalid property name: {0}
+ 無効なプロパティ名: {0}
+ {0} is an inner exception message.
+
+
+ The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
+ プロパティ ディレクティブには、'#:property PropertyName=PropertyValue' のように '=' で区切られた 2 つの部分が必要です。
+ {Locked="#:property"}
+
+
+ Directives currently cannot contain double quotes (").
+ ディレクティブには二重引用符 (") を含めることはできません。
+
+
+
+ Static graph restore is not supported for file-based apps. Remove the '#:property'.
+ 静的グラフの復元はファイルベースのアプリではサポートされていません。'#:property' を削除します。
+ {Locked="#:property"}
+
+
+ Unrecognized directive '{0}'.
+ 認識されないディレクティブ '{0}' です。
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+
+
\ No newline at end of file
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.ko.xlf b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.ko.xlf
new file mode 100644
index 000000000000..d65519a8a4e0
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.ko.xlf
@@ -0,0 +1,77 @@
+
+
+
+
+
+ Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
+ 일부 지시문을 변환할 수 없습니다. 파일을 실행하여 모든 컴파일 오류를 확인하세요. 변환을 강제로 진행하려면 '--force'를 지정하세요.
+ {Locked="--force"}
+
+
+ Could not find any project in `{0}`.
+ '{0}'에서 프로젝트를 찾을 수 없습니다.
+
+
+
+ Could not find project or directory `{0}`.
+ 프로젝트 또는 디렉터리 {0}을(를) 찾을 수 없습니다.
+
+
+
+ error
+ 오류
+ Used when reporting directive errors like "file(location): error: message".
+
+
+ Duplicate directives are not supported: {0}
+ 중복 지시문은 지원되지 않습니다. {0}
+ {0} is the directive type and name.
+
+
+ The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
+ 지시문에는 특수 문자가 없는 이름과 '#:{0} 이름{1}값'과 같이 '{1}'(으)로 구분된 선택적 값이 포함되어야 합니다.
+ {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
+
+
+ The '#:project' directive is invalid: {0}
+ '#:p roject' 지시문이 잘못되었습니다. {0}
+ {0} is the inner error message.
+
+
+ Missing name of '{0}'.
+ '{0}' 이름이 없습니다.
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+ Found more than one project in `{0}`. Specify which one to use.
+ '{0}'에서 프로젝트를 두 개 이상 찾았습니다. 사용할 프로젝트를 지정하세요.
+
+
+
+ Invalid property name: {0}
+ 잘못된 속성 이름: {0}
+ {0} is an inner exception message.
+
+
+ The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
+ property 지시문에는 '#:property PropertyName=PropertyValue'와 같이 '='로 구분된 두 부분이 있어야 합니다.
+ {Locked="#:property"}
+
+
+ Directives currently cannot contain double quotes (").
+ 지시문은 현재 큰따옴표(")를 포함할 수 없습니다.
+
+
+
+ Static graph restore is not supported for file-based apps. Remove the '#:property'.
+ 정적 그래프 복원은 파일 기반 앱에서 지원되지 않습니다. '#:property'를 제거합니다.
+ {Locked="#:property"}
+
+
+ Unrecognized directive '{0}'.
+ 인식할 수 없는 지시문 '{0}'입니다.
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+
+
\ No newline at end of file
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.pl.xlf b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.pl.xlf
new file mode 100644
index 000000000000..4cf66127fa52
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.pl.xlf
@@ -0,0 +1,77 @@
+
+
+
+
+
+ Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
+ Nie można przekonwertować niektórych dyrektyw. Uruchom plik, aby wyświetlić wszystkie błędy kompilacji. Określ element „--force”, aby mimo to przekonwertować.
+ {Locked="--force"}
+
+
+ Could not find any project in `{0}`.
+ Nie można odnaleźć żadnego projektu w lokalizacji „{0}”.
+
+
+
+ Could not find project or directory `{0}`.
+ Nie można odnaleźć projektu ani katalogu „{0}”.
+
+
+
+ error
+ błąd
+ Used when reporting directive errors like "file(location): error: message".
+
+
+ Duplicate directives are not supported: {0}
+ Zduplikowane dyrektywy nie są obsługiwane: {0}
+ {0} is the directive type and name.
+
+
+ The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
+ Dyrektywa powinna zawierać nazwę bez znaków specjalnych i opcjonalną wartość rozdzieloną znakiem "{1}#:{0} Name{1}Value".
+ {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
+
+
+ The '#:project' directive is invalid: {0}
+ Dyrektywa „#:project” jest nieprawidłowa: {0}
+ {0} is the inner error message.
+
+
+ Missing name of '{0}'.
+ Brak nazwy „{0}”.
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+ Found more than one project in `{0}`. Specify which one to use.
+ Znaleziono więcej niż jeden projekt w lokalizacji „{0}”. Określ, który ma zostać użyty.
+
+
+
+ Invalid property name: {0}
+ Nieprawidłowa nazwa właściwości: {0}
+ {0} is an inner exception message.
+
+
+ The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
+ Dyrektywa właściwości musi mieć dwie części oddzielone znakiem „=”, na przykład „#:property PropertyName=PropertyValue”.
+ {Locked="#:property"}
+
+
+ Directives currently cannot contain double quotes (").
+ Dyrektywy nie mogą obecnie zawierać podwójnych cudzysłowów (").
+
+
+
+ Static graph restore is not supported for file-based apps. Remove the '#:property'.
+ Przywracanie statycznego grafu nie jest obsługiwane w przypadku aplikacji opartych na plikach. Usuń element „#:property”.
+ {Locked="#:property"}
+
+
+ Unrecognized directive '{0}'.
+ Nierozpoznana dyrektywa „{0}”.
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+
+
\ No newline at end of file
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.pt-BR.xlf b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.pt-BR.xlf
new file mode 100644
index 000000000000..732bdffaeaba
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.pt-BR.xlf
@@ -0,0 +1,77 @@
+
+
+
+
+
+ Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
+ Algumas diretivas não podem ser convertidas. Execute o arquivo para ver todos os erros de compilação. Especifique '--force' para converter mesmo assim.
+ {Locked="--force"}
+
+
+ Could not find any project in `{0}`.
+ Não foi possível encontrar nenhum projeto em ‘{0}’.
+
+
+
+ Could not find project or directory `{0}`.
+ Não foi possível encontrar o projeto ou diretório ‘{0}’.
+
+
+
+ error
+ erro
+ Used when reporting directive errors like "file(location): error: message".
+
+
+ Duplicate directives are not supported: {0}
+ Diretivas duplicadas não são suportadas:{0}
+ {0} is the directive type and name.
+
+
+ The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
+ A diretiva deve conter um nome sem caracteres especiais e um valor opcional separado por '{1}' como '#:{0} Nome{1}Valor'.
+ {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
+
+
+ The '#:project' directive is invalid: {0}
+ A diretiva '#:project' é inválida:{0}
+ {0} is the inner error message.
+
+
+ Missing name of '{0}'.
+ Nome de '{0}' ausente.
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+ Found more than one project in `{0}`. Specify which one to use.
+ Foi encontrado mais de um projeto em ‘{0}’. Especifique qual deve ser usado.
+
+
+
+ Invalid property name: {0}
+ Nome de propriedade inválido: {0}
+ {0} is an inner exception message.
+
+
+ The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
+ A diretiva de propriedade precisa ter duas partes separadas por '=' como '#:property PropertyName=PropertyValue'.
+ {Locked="#:property"}
+
+
+ Directives currently cannot contain double quotes (").
+ No momento, as diretivas não podem conter aspas duplas (").
+
+
+
+ Static graph restore is not supported for file-based apps. Remove the '#:property'.
+ A restauração de grafo estático não é suportada para aplicativos baseados em arquivos. Remova '#:property'.
+ {Locked="#:property"}
+
+
+ Unrecognized directive '{0}'.
+ Diretiva não reconhecida '{0}'.
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+
+
\ No newline at end of file
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.ru.xlf b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.ru.xlf
new file mode 100644
index 000000000000..ca7d77675a4f
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.ru.xlf
@@ -0,0 +1,77 @@
+
+
+
+
+
+ Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
+ Некоторые директивы невозможно преобразовать. Запустите файл, чтобы увидеть все ошибки компиляции. Укажите параметр "--force", чтобы выполнить преобразование, невзирая на ошибки.
+ {Locked="--force"}
+
+
+ Could not find any project in `{0}`.
+ Не удалось найти проекты в "{0}".
+
+
+
+ Could not find project or directory `{0}`.
+ Не удалось найти проект или каталог "{0}".
+
+
+
+ error
+ ошибка
+ Used when reporting directive errors like "file(location): error: message".
+
+
+ Duplicate directives are not supported: {0}
+ Повторяющиеся директивы не поддерживаются: {0}
+ {0} is the directive type and name.
+
+
+ The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
+ Директива должна содержать имя без специальных символов и необязательное значение, разделенные символом-разделителем "{1}", например "#:{0} Имя{1}Значение".
+ {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
+
+
+ The '#:project' directive is invalid: {0}
+ Недопустимая директива "#:project": {0}
+ {0} is the inner error message.
+
+
+ Missing name of '{0}'.
+ Отсутствует имя "{0}".
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+ Found more than one project in `{0}`. Specify which one to use.
+ Найдено несколько проектов в "{0}". Выберите один.
+
+
+
+ Invalid property name: {0}
+ Недопустимое имя свойства: {0}
+ {0} is an inner exception message.
+
+
+ The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
+ Директива свойства должна иметь две части, разделенные символом "=", например "#:property PropertyName=PropertyValue".
+ {Locked="#:property"}
+
+
+ Directives currently cannot contain double quotes (").
+ В директивах пока нельзя использовать двойные кавычки (").
+
+
+
+ Static graph restore is not supported for file-based apps. Remove the '#:property'.
+ Восстановление статического графа не поддерживается для приложений на основе файлов. Удалите "#:property".
+ {Locked="#:property"}
+
+
+ Unrecognized directive '{0}'.
+ Нераспознанная директива "{0}".
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+
+
\ No newline at end of file
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.tr.xlf b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.tr.xlf
new file mode 100644
index 000000000000..aa8bf66a3cdc
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.tr.xlf
@@ -0,0 +1,77 @@
+
+
+
+
+
+ Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
+ Bazı yönergeler dönüştürülemez. Tüm derleme hatalarını görmek için dosyayı çalıştırın. Yine de dönüştürmek için '--force' belirtin.
+ {Locked="--force"}
+
+
+ Could not find any project in `{0}`.
+ `{0}` içinde proje bulunamadı.
+
+
+
+ Could not find project or directory `{0}`.
+ `{0}` projesi veya dizini bulunamadı.
+
+
+
+ error
+ hata
+ Used when reporting directive errors like "file(location): error: message".
+
+
+ Duplicate directives are not supported: {0}
+ Yinelenen yönergeler desteklenmez: {0}
+ {0} is the directive type and name.
+
+
+ The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
+ Yönerge, özel karakterler içermeyen bir ad ve ‘#:{0} Ad{1}Değer’ gibi '{1}' ile ayrılmış isteğe bağlı bir değer içermelidir.
+ {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
+
+
+ The '#:project' directive is invalid: {0}
+ ‘#:project’ yönergesi geçersizdir: {0}
+ {0} is the inner error message.
+
+
+ Missing name of '{0}'.
+ '{0}' adı eksik.
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+ Found more than one project in `{0}`. Specify which one to use.
+ `{0}` içinde birden fazla proje bulundu. Hangisinin kullanılacağını belirtin.
+
+
+
+ Invalid property name: {0}
+ Geçersiz özellik adı: {0}
+ {0} is an inner exception message.
+
+
+ The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
+ Özellik yönergesi, ‘#:property PropertyName=PropertyValue’ gibi ‘=’ ile ayrılmış iki bölümden oluşmalıdır.
+ {Locked="#:property"}
+
+
+ Directives currently cannot contain double quotes (").
+ Yönergeler şu anda çift tırnak (") içeremez.
+
+
+
+ Static graph restore is not supported for file-based apps. Remove the '#:property'.
+ Dosya tabanlı uygulamalar için statik grafik geri yükleme desteklenmemektedir. ‘#:property’i kaldırın.
+ {Locked="#:property"}
+
+
+ Unrecognized directive '{0}'.
+ Tanınmayan yönerge '{0}'.
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+
+
\ No newline at end of file
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.zh-Hans.xlf b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.zh-Hans.xlf
new file mode 100644
index 000000000000..7a3b8fdc7a4e
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.zh-Hans.xlf
@@ -0,0 +1,77 @@
+
+
+
+
+
+ Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
+ 一些指令无法转换。运行该文件以查看所有编译错误。请指定 '--force' 以进行转换。
+ {Locked="--force"}
+
+
+ Could not find any project in `{0}`.
+ “{0}”中找不到任何项目。
+
+
+
+ Could not find project or directory `{0}`.
+ 找不到项目或目录“{0}”。
+
+
+
+ error
+ 错误
+ Used when reporting directive errors like "file(location): error: message".
+
+
+ Duplicate directives are not supported: {0}
+ 不支持重复指令: {0}
+ {0} is the directive type and name.
+
+
+ The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
+ 该指令应包含一个不带特殊字符的名称,以及一个以 '#:{0} Name{1}Value' 等 ‘{1}’ 分隔的可选值。
+ {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
+
+
+ The '#:project' directive is invalid: {0}
+ '#:project' 指令无效: {0}
+ {0} is the inner error message.
+
+
+ Missing name of '{0}'.
+ 缺少 '{0}' 的名称。
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+ Found more than one project in `{0}`. Specify which one to use.
+ 在“{0}”中找到多个项目。请指定使用哪一个。
+
+
+
+ Invalid property name: {0}
+ 属性名无效: {0}
+ {0} is an inner exception message.
+
+
+ The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
+ 属性指令需要包含两个由 ‘=’ 分隔的部件,例如 '#:property PropertyName=PropertyValue'。
+ {Locked="#:property"}
+
+
+ Directives currently cannot contain double quotes (").
+ 指令当前不能包含双引号(")。
+
+
+
+ Static graph restore is not supported for file-based apps. Remove the '#:property'.
+ 基于文件的应用不支持静态图形还原。移除 '#:property'。
+ {Locked="#:property"}
+
+
+ Unrecognized directive '{0}'.
+ 无法识别的指令 ‘{0}’。
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+
+
\ No newline at end of file
diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.zh-Hant.xlf b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.zh-Hant.xlf
new file mode 100644
index 000000000000..d865da88d7d8
--- /dev/null
+++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/xlf/FileBasedProgramsResources.zh-Hant.xlf
@@ -0,0 +1,77 @@
+
+
+
+
+
+ Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
+ 無法轉換某些指示詞。執行檔案以查看所有編譯錯誤。指定 '--force' 以繼續轉換。
+ {Locked="--force"}
+
+
+ Could not find any project in `{0}`.
+ 在 `{0}` 中找不到任何專案。
+
+
+
+ Could not find project or directory `{0}`.
+ 找不到專案或目錄 `{0}`。
+
+
+
+ error
+ 錯誤
+ Used when reporting directive errors like "file(location): error: message".
+
+
+ Duplicate directives are not supported: {0}
+ 不支援重複的指示詞: {0}
+ {0} is the directive type and name.
+
+
+ The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
+ 指示詞應包含不含特殊字元的名稱,以及 '{1}' 分隔的選用值,例如 '#:{0} Name{1}Value'。
+ {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
+
+
+ The '#:project' directive is invalid: {0}
+ '#:project' 指示詞無效: {0}
+ {0} is the inner error message.
+
+
+ Missing name of '{0}'.
+ 缺少 '{0}' 的名稱。
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+ Found more than one project in `{0}`. Specify which one to use.
+ 在 `{0}` 中找到多個專案。請指定要使用的專案。
+
+
+
+ Invalid property name: {0}
+ 屬性名稱無效: {0}
+ {0} is an inner exception message.
+
+
+ The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
+ 屬性指示詞必須有兩個部分,其以 '=' 分隔,例如 '#:property PropertyName=PropertyValue'。
+ {Locked="#:property"}
+
+
+ Directives currently cannot contain double quotes (").
+ 指令目前不能包含雙引號 (")。
+
+
+
+ Static graph restore is not supported for file-based apps. Remove the '#:property'.
+ 檔案型應用程式不支援靜態圖表還原。移除 ''#:property'。
+ {Locked="#:property"}
+
+
+ Unrecognized directive '{0}'.
+ 無法識別的指示詞 '{0}'。
+ {0} is the directive name like 'package' or 'sdk'.
+
+
+
+
\ No newline at end of file
diff --git a/src/Cli/dotnet/CliStrings.resx b/src/Cli/dotnet/CliStrings.resx
index bd4864527b9c..fa4e0a6fc5d8 100644
--- a/src/Cli/dotnet/CliStrings.resx
+++ b/src/Cli/dotnet/CliStrings.resx
@@ -201,15 +201,6 @@
Required command was not provided.
-
- Could not find any project in `{0}`.
-
-
- Could not find project or directory `{0}`.
-
-
- Found more than one project in `{0}`. Specify which one to use.
-
Found a project `{0}` but it is invalid.
diff --git a/src/Cli/dotnet/CliStringsExtensions.cs b/src/Cli/dotnet/CliStringsExtensions.cs
new file mode 100644
index 000000000000..fa98cb1f1ec3
--- /dev/null
+++ b/src/Cli/dotnet/CliStringsExtensions.cs
@@ -0,0 +1,18 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using Microsoft.DotNet.Cli;
+using Microsoft.DotNet.FileBasedPrograms;
+
+///
+/// Allow convenient access to resources which are relevant to Cli scenarios but actually defined in other resource files.
+///
+internal static class CliStringsExtensions
+{
+ extension(CliStrings)
+ {
+ public static string CouldNotFindAnyProjectInDirectory => FileBasedProgramsResources.CouldNotFindAnyProjectInDirectory;
+ public static string CouldNotFindProjectOrDirectory => FileBasedProgramsResources.CouldNotFindProjectOrDirectory;
+ public static string MoreThanOneProjectInDirectory => FileBasedProgramsResources.MoreThanOneProjectInDirectory;
+ }
+}
diff --git a/src/Cli/dotnet/Commands/CliCommandStrings.resx b/src/Cli/dotnet/Commands/CliCommandStrings.resx
index 9edbd8cb434b..0789441e9856 100644
--- a/src/Cli/dotnet/Commands/CliCommandStrings.resx
+++ b/src/Cli/dotnet/Commands/CliCommandStrings.resx
@@ -1102,14 +1102,6 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man
Minimum expected tests policy violation, tests ran {0}, minimum expected {1}{0}, {1} number of tests
-
- The '#:project' directive is invalid: {0}
- {0} is the inner error message.
-
-
- Missing name of '{0}'.
- {0} is the directive name like 'package' or 'sdk'.
-
Run Microsoft Build Engine (MSBuild) commands.
@@ -1596,37 +1588,6 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man
Project(s)
-
- Invalid property name: {0}
- {0} is an inner exception message.
-
-
- The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
- {Locked="#:property"}
-
-
- Static graph restore is not supported for file-based apps. Remove the '#:property'.
- {Locked="#:property"}
-
-
- error
- Used when reporting directive errors like "file(location): error: message".
-
-
- The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
- {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
-
-
- Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
- {Locked="--force"}
-
-
- Duplicate directives are not supported: {0}
- {0} is the directive type and name.
-
-
- Directives currently cannot contain double quotes (").
-
Cannot specify option '{0}' when also using '-' to read the file from standard input.{0} is an option name like '--no-build'.
@@ -2264,10 +2225,6 @@ and the corresponding package Ids for installed tools using the command
Rows with Unlogged changes represent changes from actions other than .NET CLI workload commands. Usually this represents an update to the .NET SDK or to Visual Studio.
-
- Unrecognized directive '{0}'.
- {0} is the directive name like 'package' or 'sdk'.
-
Update all tools.
diff --git a/src/Cli/dotnet/Commands/Package/Add/PackageAddCommand.cs b/src/Cli/dotnet/Commands/Package/Add/PackageAddCommand.cs
index dc94f892abd1..93bb43ef8c24 100644
--- a/src/Cli/dotnet/Commands/Package/Add/PackageAddCommand.cs
+++ b/src/Cli/dotnet/Commands/Package/Add/PackageAddCommand.cs
@@ -11,6 +11,7 @@
using Microsoft.DotNet.Cli.Commands.Run;
using Microsoft.DotNet.Cli.Extensions;
using Microsoft.DotNet.Cli.Utils;
+using Microsoft.DotNet.FileBasedPrograms;
using NuGet.ProjectModel;
namespace Microsoft.DotNet.Cli.Commands.Package.Add;
diff --git a/src/Cli/dotnet/Commands/Package/Remove/PackageRemoveCommand.cs b/src/Cli/dotnet/Commands/Package/Remove/PackageRemoveCommand.cs
index 2706bed56b21..6f3ed29dad68 100644
--- a/src/Cli/dotnet/Commands/Package/Remove/PackageRemoveCommand.cs
+++ b/src/Cli/dotnet/Commands/Package/Remove/PackageRemoveCommand.cs
@@ -7,6 +7,7 @@
using Microsoft.DotNet.Cli.Commands.Run;
using Microsoft.DotNet.Cli.Extensions;
using Microsoft.DotNet.Cli.Utils;
+using Microsoft.DotNet.FileBasedPrograms;
namespace Microsoft.DotNet.Cli.Commands.Package.Remove;
diff --git a/src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommand.cs b/src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommand.cs
index f1bc3ab7d655..e41367a34fd0 100644
--- a/src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommand.cs
+++ b/src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommand.cs
@@ -7,6 +7,7 @@
using Microsoft.Build.Evaluation;
using Microsoft.DotNet.Cli.Commands.Run;
using Microsoft.DotNet.Cli.Utils;
+using Microsoft.DotNet.FileBasedPrograms;
using Microsoft.TemplateEngine.Cli.Commands;
namespace Microsoft.DotNet.Cli.Commands.Project.Convert;
@@ -30,7 +31,7 @@ public override int Execute()
// Find directives (this can fail, so do this before creating the target directory).
var sourceFile = SourceFile.Load(file);
- var directives = VirtualProjectBuildingCommand.FindDirectives(sourceFile, reportAllErrors: !_force, DiagnosticBag.ThrowOnFirst());
+ var directives = FileLevelDirectiveHelpers.FindDirectives(sourceFile, reportAllErrors: !_force, DiagnosticBag.ThrowOnFirst());
// Create a project instance for evaluation.
var projectCollection = new ProjectCollection();
diff --git a/src/Cli/dotnet/Commands/Run/Api/RunApiCommand.cs b/src/Cli/dotnet/Commands/Run/Api/RunApiCommand.cs
index 286a7972f6f3..4a48c4054d79 100644
--- a/src/Cli/dotnet/Commands/Run/Api/RunApiCommand.cs
+++ b/src/Cli/dotnet/Commands/Run/Api/RunApiCommand.cs
@@ -8,6 +8,7 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.DotNet.Cli.Utils;
+using Microsoft.DotNet.FileBasedPrograms;
namespace Microsoft.DotNet.Cli.Commands.Run.Api;
@@ -64,7 +65,7 @@ public sealed class GetProject : RunApiInput
public override RunApiOutput Execute()
{
var sourceFile = SourceFile.Load(EntryPointFileFullPath);
- var directives = VirtualProjectBuildingCommand.FindDirectives(sourceFile, reportAllErrors: true, DiagnosticBag.Collect(out var diagnostics));
+ var directives = FileLevelDirectiveHelpers.FindDirectives(sourceFile, reportAllErrors: true, DiagnosticBag.Collect(out var diagnostics));
string artifactsPath = ArtifactsPath ?? VirtualProjectBuildingCommand.GetArtifactsPath(EntryPointFileFullPath);
var csprojWriter = new StringWriter();
diff --git a/src/Cli/dotnet/Commands/Run/FileBasedAppSourceEditor.cs b/src/Cli/dotnet/Commands/Run/FileBasedAppSourceEditor.cs
index 45fa0380aeea..0422f389a824 100644
--- a/src/Cli/dotnet/Commands/Run/FileBasedAppSourceEditor.cs
+++ b/src/Cli/dotnet/Commands/Run/FileBasedAppSourceEditor.cs
@@ -7,6 +7,7 @@
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
+using Microsoft.DotNet.FileBasedPrograms;
namespace Microsoft.DotNet.Cli.Commands.Run;
@@ -33,7 +34,7 @@ public ImmutableArray Directives
{
if (field.IsDefault)
{
- field = VirtualProjectBuildingCommand.FindDirectives(SourceFile, reportAllErrors: false, DiagnosticBag.Ignore());
+ field = FileLevelDirectiveHelpers.FindDirectives(SourceFile, reportAllErrors: false, DiagnosticBag.Ignore());
Debug.Assert(!field.IsDefault);
}
@@ -125,7 +126,7 @@ existingDirective is CSharpDirective.Named existingNamed &&
// Otherwise, we will add the directive to the top of the file.
int start = 0;
- var tokenizer = VirtualProjectBuildingCommand.CreateTokenizer(SourceFile.Text);
+ var tokenizer = FileLevelDirectiveHelpers.CreateTokenizer(SourceFile.Text);
var result = tokenizer.ParseNextToken();
var leadingTrivia = result.Token.LeadingTrivia;
diff --git a/src/Cli/dotnet/Commands/Run/RunTelemetry.cs b/src/Cli/dotnet/Commands/Run/RunTelemetry.cs
index 1e58bdd27c05..3a42cd94c06a 100644
--- a/src/Cli/dotnet/Commands/Run/RunTelemetry.cs
+++ b/src/Cli/dotnet/Commands/Run/RunTelemetry.cs
@@ -6,6 +6,7 @@
using Microsoft.Build.Execution;
using Microsoft.DotNet.Cli.Commands.Run.LaunchSettings;
using Microsoft.DotNet.Cli.Utils;
+using Microsoft.DotNet.FileBasedPrograms;
namespace Microsoft.DotNet.Cli.Commands.Run;
diff --git a/src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs b/src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs
index bdd97d2402b7..7a4ff1295838 100644
--- a/src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs
+++ b/src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs
@@ -26,6 +26,7 @@
using Microsoft.DotNet.Cli.Commands.Restore;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Cli.Utils.Extensions;
+using Microsoft.DotNet.FileBasedPrograms;
namespace Microsoft.DotNet.Cli.Commands.Run;
@@ -171,7 +172,7 @@ public ImmutableArray Directives
if (field.IsDefault)
{
var sourceFile = SourceFile.Load(EntryPointFileFullPath);
- field = FindDirectives(sourceFile, reportAllErrors: false, DiagnosticBag.ThrowOnFirst());
+ field = FileLevelDirectiveHelpers.FindDirectives(sourceFile, reportAllErrors: false, DiagnosticBag.ThrowOnFirst());
Debug.Assert(!field.IsDefault);
}
@@ -1431,186 +1432,6 @@ static void WriteImport(TextWriter writer, string project, CSharpDirective.Sdk s
}
}
- public static SyntaxTokenParser CreateTokenizer(SourceText text)
- {
- return SyntaxFactory.CreateTokenParser(text,
- CSharpParseOptions.Default.WithFeatures([new("FileBasedProgram", "true")]));
- }
-
- ///
- /// If , the whole is parsed to find diagnostics about every app directive.
- /// Otherwise, only directives up to the first C# token is checked.
- /// The former is useful for dotnet project convert where we want to report all errors because it would be difficult to fix them up after the conversion.
- /// The latter is useful for dotnet run file.cs where if there are app directives after the first token,
- /// compiler reports anyway, so we speed up success scenarios by not parsing the whole file up front in the SDK CLI.
- ///
- public static ImmutableArray FindDirectives(SourceFile sourceFile, bool reportAllErrors, DiagnosticBag diagnostics)
- {
- var deduplicated = new HashSet(NamedDirectiveComparer.Instance);
- var builder = ImmutableArray.CreateBuilder();
- var tokenizer = CreateTokenizer(sourceFile.Text);
-
- var result = tokenizer.ParseLeadingTrivia();
- TextSpan previousWhiteSpaceSpan = default;
- var triviaList = result.Token.LeadingTrivia;
- foreach (var (index, trivia) in triviaList.Index())
- {
- // Stop when the trivia contains an error (e.g., because it's after #if).
- if (trivia.ContainsDiagnostics)
- {
- break;
- }
-
- if (trivia.IsKind(SyntaxKind.WhitespaceTrivia))
- {
- Debug.Assert(previousWhiteSpaceSpan.IsEmpty);
- previousWhiteSpaceSpan = trivia.FullSpan;
- continue;
- }
-
- if (trivia.IsKind(SyntaxKind.ShebangDirectiveTrivia))
- {
- TextSpan span = GetFullSpan(previousWhiteSpaceSpan, trivia);
-
- var whiteSpace = GetWhiteSpaceInfo(triviaList, index);
- var info = new CSharpDirective.ParseInfo
- {
- Span = span,
- LeadingWhiteSpace = whiteSpace.Leading,
- TrailingWhiteSpace = whiteSpace.Trailing,
- };
- builder.Add(new CSharpDirective.Shebang(info));
- }
- else if (trivia.IsKind(SyntaxKind.IgnoredDirectiveTrivia))
- {
- TextSpan span = GetFullSpan(previousWhiteSpaceSpan, trivia);
-
- var message = trivia.GetStructure() is IgnoredDirectiveTriviaSyntax { Content: { RawKind: (int)SyntaxKind.StringLiteralToken } content }
- ? content.Text.AsSpan().Trim()
- : "";
- var parts = Patterns.Whitespace.EnumerateSplits(message, 2);
- var name = parts.MoveNext() ? message[parts.Current] : default;
- var value = parts.MoveNext() ? message[parts.Current] : default;
- Debug.Assert(!parts.MoveNext());
-
- var whiteSpace = GetWhiteSpaceInfo(triviaList, index);
- var context = new CSharpDirective.ParseContext
- {
- Info = new()
- {
- Span = span,
- LeadingWhiteSpace = whiteSpace.Leading,
- TrailingWhiteSpace = whiteSpace.Trailing,
- },
- Diagnostics = diagnostics,
- SourceFile = sourceFile,
- DirectiveKind = name.ToString(),
- DirectiveText = value.ToString(),
- };
-
- // Block quotes now so we can later support quoted values without a breaking change. https://github.com/dotnet/sdk/issues/49367
- if (value.Contains('"'))
- {
- diagnostics.AddError(sourceFile, context.Info.Span, CliCommandStrings.QuoteInDirective);
- }
-
- if (CSharpDirective.Parse(context) is { } directive)
- {
- // If the directive is already present, report an error.
- if (deduplicated.TryGetValue(directive, out var existingDirective))
- {
- var typeAndName = $"#:{existingDirective.GetType().Name.ToLowerInvariant()} {existingDirective.Name}";
- diagnostics.AddError(sourceFile, directive.Info.Span, string.Format(CliCommandStrings.DuplicateDirective, typeAndName));
- }
- else
- {
- deduplicated.Add(directive);
- }
-
- builder.Add(directive);
- }
- }
-
- previousWhiteSpaceSpan = default;
- }
-
- // In conversion mode, we want to report errors for any invalid directives in the rest of the file
- // so users don't end up with invalid directives in the converted project.
- if (reportAllErrors)
- {
- tokenizer.ResetTo(result);
-
- do
- {
- result = tokenizer.ParseNextToken();
-
- foreach (var trivia in result.Token.LeadingTrivia)
- {
- ReportErrorFor(trivia);
- }
-
- foreach (var trivia in result.Token.TrailingTrivia)
- {
- ReportErrorFor(trivia);
- }
- }
- while (!result.Token.IsKind(SyntaxKind.EndOfFileToken));
- }
-
- // The result should be ordered by source location, RemoveDirectivesFromFile depends on that.
- return builder.ToImmutable();
-
- static TextSpan GetFullSpan(TextSpan previousWhiteSpaceSpan, SyntaxTrivia trivia)
- {
- // Include the preceding whitespace in the span, i.e., span will be the whole line.
- return previousWhiteSpaceSpan.IsEmpty ? trivia.FullSpan : TextSpan.FromBounds(previousWhiteSpaceSpan.Start, trivia.FullSpan.End);
- }
-
- void ReportErrorFor(SyntaxTrivia trivia)
- {
- if (trivia.ContainsDiagnostics && trivia.IsKind(SyntaxKind.IgnoredDirectiveTrivia))
- {
- diagnostics.AddError(sourceFile, trivia.Span, CliCommandStrings.CannotConvertDirective);
- }
- }
-
- static (WhiteSpaceInfo Leading, WhiteSpaceInfo Trailing) GetWhiteSpaceInfo(in SyntaxTriviaList triviaList, int index)
- {
- (WhiteSpaceInfo Leading, WhiteSpaceInfo Trailing) result = default;
-
- for (int i = index - 1; i >= 0; i--)
- {
- if (!Fill(ref result.Leading, triviaList, i)) break;
- }
-
- for (int i = index + 1; i < triviaList.Count; i++)
- {
- if (!Fill(ref result.Trailing, triviaList, i)) break;
- }
-
- return result;
-
- static bool Fill(ref WhiteSpaceInfo info, in SyntaxTriviaList triviaList, int index)
- {
- var trivia = triviaList[index];
- if (trivia.IsKind(SyntaxKind.EndOfLineTrivia))
- {
- info.LineBreaks += 1;
- info.TotalLength += trivia.FullSpan.Length;
- return true;
- }
-
- if (trivia.IsKind(SyntaxKind.WhitespaceTrivia))
- {
- info.TotalLength += trivia.FullSpan.Length;
- return true;
- }
-
- return false;
- }
- }
- }
-
public static SourceText? RemoveDirectivesFromFile(ImmutableArray directives, SourceText text)
{
if (directives.Length == 0)
@@ -1664,371 +1485,6 @@ public static bool IsValidEntryPointPath(string entryPointFilePath)
}
}
-internal readonly record struct SourceFile(string Path, SourceText Text)
-{
- public static SourceFile Load(string filePath)
- {
- using var stream = File.OpenRead(filePath);
- return new SourceFile(filePath, SourceText.From(stream, Encoding.UTF8));
- }
-
- public SourceFile WithText(SourceText newText)
- {
- return new SourceFile(Path, newText);
- }
-
- public void Save()
- {
- using var stream = File.Open(Path, FileMode.Create, FileAccess.Write);
- using var writer = new StreamWriter(stream, Encoding.UTF8);
- Text.Write(writer);
- }
-
- public FileLinePositionSpan GetFileLinePositionSpan(TextSpan span)
- {
- return new FileLinePositionSpan(Path, Text.Lines.GetLinePositionSpan(span));
- }
-
- public string GetLocationString(TextSpan span)
- {
- var positionSpan = GetFileLinePositionSpan(span);
- return $"{positionSpan.Path}({positionSpan.StartLinePosition.Line + 1})";
- }
-}
-
-internal static partial class Patterns
-{
- [GeneratedRegex("""\s+""")]
- public static partial Regex Whitespace { get; }
-
- [GeneratedRegex("""[\s@=/]""")]
- public static partial Regex DisallowedNameCharacters { get; }
-
- [GeneratedRegex("""^/\w+:".*"$""", RegexOptions.Singleline)]
- public static partial Regex EscapedCompilerOption { get; }
-}
-
-internal struct WhiteSpaceInfo
-{
- public int LineBreaks;
- public int TotalLength;
-}
-
-///
-/// Represents a C# directive starting with #: (a.k.a., "file-level directive").
-/// Those are ignored by the language but recognized by us.
-///
-internal abstract class CSharpDirective(in CSharpDirective.ParseInfo info)
-{
- public ParseInfo Info { get; } = info;
-
- public readonly struct ParseInfo
- {
- ///
- /// Span of the full line including the trailing line break.
- ///
- public required TextSpan Span { get; init; }
- public required WhiteSpaceInfo LeadingWhiteSpace { get; init; }
- public required WhiteSpaceInfo TrailingWhiteSpace { get; init; }
- }
-
- public readonly struct ParseContext
- {
- public required ParseInfo Info { get; init; }
- public required DiagnosticBag Diagnostics { get; init; }
- public required SourceFile SourceFile { get; init; }
- public required string DirectiveKind { get; init; }
- public required string DirectiveText { get; init; }
- }
-
- public static Named? Parse(in ParseContext context)
- {
- return context.DirectiveKind switch
- {
- "sdk" => Sdk.Parse(context),
- "property" => Property.Parse(context),
- "package" => Package.Parse(context),
- "project" => Project.Parse(context),
- var other => context.Diagnostics.AddError(context.SourceFile, context.Info.Span, string.Format(CliCommandStrings.UnrecognizedDirective, other)),
- };
- }
-
- private static (string, string?)? ParseOptionalTwoParts(in ParseContext context, char separator)
- {
- var separatorIndex = context.DirectiveText.IndexOf(separator, StringComparison.Ordinal);
- var firstPart = (separatorIndex < 0 ? context.DirectiveText : context.DirectiveText.AsSpan(..separatorIndex)).TrimEnd();
-
- string directiveKind = context.DirectiveKind;
- if (firstPart.IsWhiteSpace())
- {
- return context.Diagnostics.AddError<(string, string?)?>(context.SourceFile, context.Info.Span, string.Format(CliCommandStrings.MissingDirectiveName, directiveKind));
- }
-
- // If the name contains characters that resemble separators, report an error to avoid any confusion.
- if (Patterns.DisallowedNameCharacters.IsMatch(firstPart))
- {
- return context.Diagnostics.AddError<(string, string?)?>(context.SourceFile, context.Info.Span, string.Format(CliCommandStrings.InvalidDirectiveName, directiveKind, separator));
- }
-
- if (separatorIndex < 0)
- {
- return (firstPart.ToString(), null);
- }
-
- var secondPart = context.DirectiveText.AsSpan((separatorIndex + 1)..).TrimStart();
- if (secondPart.IsWhiteSpace())
- {
- Debug.Assert(secondPart.Length == 0,
- "We have trimmed the second part, so if it's white space, it should be actually empty.");
-
- return (firstPart.ToString(), string.Empty);
- }
-
- return (firstPart.ToString(), secondPart.ToString());
- }
-
- public abstract override string ToString();
-
- ///
- /// #! directive.
- ///
- public sealed class Shebang(in ParseInfo info) : CSharpDirective(info)
- {
- public override string ToString() => "#!";
- }
-
- public abstract class Named(in ParseInfo info) : CSharpDirective(info)
- {
- public required string Name { get; init; }
- }
-
- ///
- /// #:sdk directive.
- ///
- public sealed class Sdk(in ParseInfo info) : Named(info)
- {
- public string? Version { get; init; }
-
- public static new Sdk? Parse(in ParseContext context)
- {
- if (ParseOptionalTwoParts(context, separator: '@') is not var (sdkName, sdkVersion))
- {
- return null;
- }
-
- return new Sdk(context.Info)
- {
- Name = sdkName,
- Version = sdkVersion,
- };
- }
-
- public override string ToString() => Version is null ? $"#:sdk {Name}" : $"#:sdk {Name}@{Version}";
- }
-
- ///
- /// #:property directive.
- ///
- public sealed class Property(in ParseInfo info) : Named(info)
- {
- public required string Value { get; init; }
-
- public static new Property? Parse(in ParseContext context)
- {
- if (ParseOptionalTwoParts(context, separator: '=') is not var (propertyName, propertyValue))
- {
- return null;
- }
-
- if (propertyValue is null)
- {
- return context.Diagnostics.AddError(context.SourceFile, context.Info.Span, CliCommandStrings.PropertyDirectiveMissingParts);
- }
-
- try
- {
- propertyName = XmlConvert.VerifyName(propertyName);
- }
- catch (XmlException ex)
- {
- return context.Diagnostics.AddError(context.SourceFile, context.Info.Span, string.Format(CliCommandStrings.PropertyDirectiveInvalidName, ex.Message), ex);
- }
-
- if (propertyName.Equals("RestoreUseStaticGraphEvaluation", StringComparison.OrdinalIgnoreCase) &&
- MSBuildUtilities.ConvertStringToBool(propertyValue))
- {
- context.Diagnostics.AddError(context.SourceFile, context.Info.Span, CliCommandStrings.StaticGraphRestoreNotSupported);
- }
-
- return new Property(context.Info)
- {
- Name = propertyName,
- Value = propertyValue,
- };
- }
-
- public override string ToString() => $"#:property {Name}={Value}";
- }
-
- ///
- /// #:package directive.
- ///
- public sealed class Package(in ParseInfo info) : Named(info)
- {
- public string? Version { get; init; }
-
- public static new Package? Parse(in ParseContext context)
- {
- if (ParseOptionalTwoParts(context, separator: '@') is not var (packageName, packageVersion))
- {
- return null;
- }
-
- return new Package(context.Info)
- {
- Name = packageName,
- Version = packageVersion,
- };
- }
-
- public override string ToString() => Version is null ? $"#:package {Name}" : $"#:package {Name}@{Version}";
- }
-
- ///
- /// #:project directive.
- ///
- public sealed class Project(in ParseInfo info) : Named(info)
- {
- public static new Project? Parse(in ParseContext context)
- {
- var directiveText = context.DirectiveText;
- if (directiveText.IsWhiteSpace())
- {
- string directiveKind = context.DirectiveKind;
- return context.Diagnostics.AddError(context.SourceFile, context.Info.Span, string.Format(CliCommandStrings.MissingDirectiveName, directiveKind));
- }
-
- try
- {
- // If the path is a directory like '../lib', transform it to a project file path like '../lib/lib.csproj'.
- // Also normalize blackslashes to forward slashes to ensure the directive works on all platforms.
- var sourceDirectory = Path.GetDirectoryName(context.SourceFile.Path) ?? ".";
- var resolvedProjectPath = Path.Combine(sourceDirectory, directiveText.Replace('\\', '/'));
- if (Directory.Exists(resolvedProjectPath))
- {
- var fullFilePath = MsbuildProject.GetProjectFileFromDirectory(resolvedProjectPath).FullName;
-
- // Keep a relative path only if the original directive was a relative path.
- directiveText = Path.IsPathFullyQualified(directiveText)
- ? fullFilePath
- : Path.GetRelativePath(relativeTo: sourceDirectory, fullFilePath);
- }
- else if (!File.Exists(resolvedProjectPath))
- {
- throw new GracefulException(CliStrings.CouldNotFindProjectOrDirectory, resolvedProjectPath);
- }
- }
- catch (GracefulException e)
- {
- context.Diagnostics.AddError(context.SourceFile, context.Info.Span, string.Format(CliCommandStrings.InvalidProjectDirective, e.Message), e);
- }
-
- return new Project(context.Info)
- {
- Name = directiveText,
- };
- }
-
- public Project WithName(string name)
- {
- return new Project(Info) { Name = name };
- }
-
- public override string ToString() => $"#:project {Name}";
- }
-}
-
-///
-/// Used for deduplication - compares directives by their type and name (ignoring case).
-///
-internal sealed class NamedDirectiveComparer : IEqualityComparer
-{
- public static readonly NamedDirectiveComparer Instance = new();
-
- private NamedDirectiveComparer() { }
-
- public bool Equals(CSharpDirective.Named? x, CSharpDirective.Named? y)
- {
- if (ReferenceEquals(x, y)) return true;
-
- if (x is null || y is null) return false;
-
- return x.GetType() == y.GetType() &&
- string.Equals(x.Name, y.Name, StringComparison.OrdinalIgnoreCase);
- }
-
- public int GetHashCode(CSharpDirective.Named obj)
- {
- return HashCode.Combine(
- obj.GetType().GetHashCode(),
- obj.Name.GetHashCode(StringComparison.OrdinalIgnoreCase));
- }
-}
-
-internal sealed class SimpleDiagnostic
-{
- public required Position Location { get; init; }
- public required string Message { get; init; }
-
- ///
- /// An adapter of that ensures we JSON-serialize only the necessary fields.
- ///
- public readonly struct Position
- {
- public string Path { get; init; }
- public LinePositionSpan Span { get; init; }
-
- public static implicit operator Position(FileLinePositionSpan fileLinePositionSpan) => new()
- {
- Path = fileLinePositionSpan.Path,
- Span = fileLinePositionSpan.Span,
- };
- }
-}
-
-internal readonly struct DiagnosticBag
-{
- public bool IgnoreDiagnostics { get; private init; }
-
- ///
- /// If and is , the first diagnostic is thrown as .
- ///
- public ImmutableArray.Builder? Builder { get; private init; }
-
- public static DiagnosticBag ThrowOnFirst() => default;
- public static DiagnosticBag Collect(out ImmutableArray.Builder builder) => new() { Builder = builder = ImmutableArray.CreateBuilder() };
- public static DiagnosticBag Ignore() => new() { IgnoreDiagnostics = true, Builder = null };
-
- public void AddError(SourceFile sourceFile, TextSpan span, string message, Exception? inner = null)
- {
- if (Builder != null)
- {
- Debug.Assert(!IgnoreDiagnostics);
- Builder.Add(new SimpleDiagnostic { Location = sourceFile.GetFileLinePositionSpan(span), Message = message });
- }
- else if (!IgnoreDiagnostics)
- {
- throw new GracefulException($"{sourceFile.GetLocationString(span)}: {CliCommandStrings.DirectiveError}: {message}", inner);
- }
- }
-
- public T? AddError(SourceFile sourceFile, TextSpan span, string message, Exception? inner = null)
- {
- AddError(sourceFile, span, message, inner);
- return default;
- }
-}
-
internal sealed class RunFileBuildCacheEntry
{
private static StringComparer GlobalPropertiesComparer => StringComparer.OrdinalIgnoreCase;
diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.cs.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.cs.xlf
index 74f9655c6a71..dc60b4b60418 100644
--- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.cs.xlf
+++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.cs.xlf
@@ -184,11 +184,6 @@ Prohledané cesty: „{1}“, „{2}“.
Možnosti {0} a {1} nelze použít společně. Jednu z možností odeberte.
-
- Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
- Některé direktivy nelze převést. Spuštěním souboru zobrazíte všechny chyby kompilace. Zadejte „--force“, pokud chcete přesto provést převod.
- {Locked="--force"}
- Cannot find a tool in the manifest file that has a command named '{0}'.V souboru manifestu se nepovedlo najít nástroj, který obsahuje příkaz s názvem {0}.
@@ -1121,11 +1116,6 @@ Další informace najdete na https://aka.ms/dotnet-test/mtp.
Povolí diagnostický výstup.
-
- error
- chyba
- Used when reporting directive errors like "file(location): error: message".
- Removed '{0}' directives ({1}) for '{2}' from: {3}Odebrány direktivy {0} ({1}) pro {2} z umístění: {3}
@@ -1226,11 +1216,6 @@ Make the profile names distinct.
Nastavte odlišné názvy profilů.
-
- Duplicate directives are not supported: {0}
- Duplicitní direktivy nejsou podporovány: {0}
- {0} is the directive type and name.
- duration:doba trvání:
@@ -1586,11 +1571,6 @@ Nastavte odlišné názvy profilů.
Metoda {0} nebyla úspěšně ukončena.
-
- The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
- Direktiva by měla obsahovat název bez speciálních znaků a volitelnou hodnotu oddělenou znakem {1}, například #:{0} Název{1}Hodnota.
- {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
- The specified file must exist and have '.cs' file extension: '{0}'Zadaný soubor musí existovat a musí mít příponu souboru .cs:{0}
@@ -1606,11 +1586,6 @@ Nastavte odlišné názvy profilů.
Nelze zadat parametr {0}, pokud se k načtení souboru ze standardního vstupního zařízení používá také parametr -.{0} is an option name like '--no-build'.
-
- The '#:project' directive is invalid: {0}
- Direktiva #:project je neplatná: {0}
- {0} is the inner error message.
- Failed to parse "{0}" as a semantic version.Nepovedlo se analyzovat {0} jako sémantickou verzi.
@@ -1748,11 +1723,6 @@ Nástroj {1} (verze {2}) se úspěšně nainstaloval. Do souboru manifestu {3} s
Byla přijata nová zpráva metodou handshake {0} pro testovací aplikaci, který neodpovídá předchozí zprávě metodou handshake {1}.
-
- Missing name of '{0}'.
- Chybí název pro: {0}.
- {0} is the directive name like 'package' or 'sdk'.
- A test session start event was received without a corresponding test session end.Byla přijata počáteční událost testovací relace bez odpovídajícího konce testovací relace.
@@ -2515,16 +2485,6 @@ Nástroj {1} (verze {2}) se úspěšně nainstaloval. Do souboru manifestu {3} s
Projekty
-
- Invalid property name: {0}
- Neplatný název vlastnosti: {0}
- {0} is an inner exception message.
-
-
- The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
- Direktiva property musí mít dvě části oddělené znakem =, například #:property PropertyName=PropertyValue.
- {Locked="#:property"}
- Publisher for the .NET PlatformVydavatel pro platformu .NET
@@ -2567,11 +2527,6 @@ The default is to publish a framework-dependent application.
Ve výchozím nastavení je publikována aplikace závislá na architektuře.
-
- Directives currently cannot contain double quotes (").
- Direktivy v současné době nemůžou obsahovat dvojité uvozovky (").
-
- Shut down the Razor build server.Vypne buildovací server Razor.
@@ -3076,11 +3031,6 @@ Cílem projektu je více architektur. Pomocí parametru {0} určete, která arch
Standardní výstup
-
- Static graph restore is not supported for file-based apps. Remove the '#:property'.
- Statické obnovení grafu se pro souborové aplikace nepodporuje. Odeberte #:property.
- {Locked="#:property"}
- StatusStav
@@ -3627,11 +3577,6 @@ příkazu „dotnet tool list“.
Řádky s nezaprotokolovanými změnami představují změny z jiných akcí než příkazů úloh rozhraní příkazového řádku .NET. Obvykle to představuje aktualizaci sady .NET SDK nebo sady Visual Studio.
-
- Unrecognized directive '{0}'.
- Nerozpoznaná direktiva {0}.
- {0} is the directive name like 'package' or 'sdk'.
- Update all tools.Aktualizuje všechny nástroje.
diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.de.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.de.xlf
index a809278b1534..618b01494930 100644
--- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.de.xlf
+++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.de.xlf
@@ -184,11 +184,6 @@ Durchsuchte Pfade: "{1}", "{2}".
Die Optionen {0} und {1} können nicht zusammen verwendet werden. Entfernen Sie eine der Optionen.
-
- Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
- Einige Anweisungen können nicht konvertiert werden. Führen Sie die Datei aus, um alle Kompilierungsfehler anzuzeigen. Geben Sie „--force“ an, um das Umwandeln trotzdem auszuführen.
- {Locked="--force"}
- Cannot find a tool in the manifest file that has a command named '{0}'.In der Manifestdatei wurde kein Tool mit einem Befehl namens "{0}" gefunden.
@@ -1121,11 +1116,6 @@ Weitere Informationen finden Sie unter https://aka.ms/dotnet-test/mtp.
Aktiviert die Diagnoseausgabe.
-
- error
- Fehler
- Used when reporting directive errors like "file(location): error: message".
- Removed '{0}' directives ({1}) for '{2}' from: {3}Die „{0}“-Direktiven ({1}) für „{2}“ wurden aus folgender Datei entfernt: {3}
@@ -1226,11 +1216,6 @@ Make the profile names distinct.
Erstellen Sie eindeutige Profilnamen.
-
- Duplicate directives are not supported: {0}
- Doppelte Anweisungen werden nicht unterstützt: {0}
- {0} is the directive type and name.
- duration:Dauer:
@@ -1586,11 +1571,6 @@ Erstellen Sie eindeutige Profilnamen.
Die Methode "{0}" wurde nicht erfolgreich beendet
-
- The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
- Die Anweisung sollte einen Namen ohne Sonderzeichen und einen optionalen Wert enthalten, die durch „{1}“ getrennt sind, wie „#:{0} Name{1}Wert“.
- {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
- The specified file must exist and have '.cs' file extension: '{0}'Die angegebene Datei muss vorhanden sein und die Dateierweiterung ".cs" aufweisen: "{0}".
@@ -1606,11 +1586,6 @@ Erstellen Sie eindeutige Profilnamen.
Die Option „{0}“ kann nicht angegeben werden, wenn auch „-“ zum Lesen der Datei aus der Standardeingabe verwendet wird.{0} is an option name like '--no-build'.
-
- The '#:project' directive is invalid: {0}
- Die Anweisung „#:p roject“ ist ungültig: {0}
- {0} is the inner error message.
- Failed to parse "{0}" as a semantic version.Fehler beim Analysieren von "{0}" als semantische Version.
@@ -1748,11 +1723,6 @@ Das Tool "{1}" (Version {2}) wurde erfolgreich installiert. Der Eintrag wird der
Für die Testanwendung wurde ein neuer Handshake „{0}“ empfangen, der nicht mit dem vorherigen Handshake „{1}“ übereinstimmt.
-
- Missing name of '{0}'.
- Fehlender Name der Anweisung „{0}“.
- {0} is the directive name like 'package' or 'sdk'.
- A test session start event was received without a corresponding test session end.Ein Testsitzungs-Startereignis wurde ohne entsprechendes Testsitzungs-Ende empfangen.
@@ -2515,16 +2485,6 @@ Das Tool "{1}" (Version {2}) wurde erfolgreich installiert. Der Eintrag wird der
Projekt(e)
-
- Invalid property name: {0}
- Ungültiger Eigenschaftenname: {0}
- {0} is an inner exception message.
-
-
- The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
- Die Eigenschaftsanweisung muss zwei durch „=“ getrennte Teile aufweisen, z. B. „#:property PropertyName=PropertyValue“.
- {Locked="#:property"}
- Publisher for the .NET PlatformHerausgeber für die .NET-Plattform
@@ -2567,11 +2527,6 @@ The default is to publish a framework-dependent application.
Standardmäßig wird eine Framework-abhängige Anwendung veröffentlicht.
-
- Directives currently cannot contain double quotes (").
- Direktiven dürfen derzeit keine doppelten Anführungszeichen (") enthalten.
-
- Shut down the Razor build server.Hiermit wird der Razor-Buildserver heruntergefahren.
@@ -3076,11 +3031,6 @@ Ihr Projekt verwendet mehrere Zielframeworks. Geben Sie über "{0}" an, welches
Standardausgabe
-
- Static graph restore is not supported for file-based apps. Remove the '#:property'.
- Die Statische Graphwiederherstellung wird für dateibasierte Apps nicht unterstützt. Entfernen Sie '#:property'.
- {Locked="#:property"}
- StatusStatus
@@ -3627,11 +3577,6 @@ und die zugehörigen Paket-IDs für installierte Tools über den Befehl
Zeilen mit nicht protokollierten Änderungen stellen Änderungen von anderen Aktionen als .NET CLI-Workloadbefehlen dar. In der Regel stellt dies ein Update für das .NET SDK oder für Visual Studio dar.
-
- Unrecognized directive '{0}'.
- Unbekannte Anweisung „{0}“.
- {0} is the directive name like 'package' or 'sdk'.
- Update all tools.Alle Tools aktualisieren.
diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.es.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.es.xlf
index 792aa0a8a117..00c153cce71e 100644
--- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.es.xlf
+++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.es.xlf
@@ -184,11 +184,6 @@ Rutas de acceso buscadas: "{1}", "{2}".
No se pueden usar las opciones {0} y {1} juntas. Quite una de las opciones.
-
- Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
- Algunas directivas no se pueden convertir. Ejecute el archivo para ver todos los errores de compilación. Especifique "--force" para convertir de todos modos.
- {Locked="--force"}
- Cannot find a tool in the manifest file that has a command named '{0}'.No se encuentra una herramienta en el manifiesto de archivo que tiene un comando denominado "{0}".
@@ -1121,11 +1116,6 @@ Consulte https://aka.ms/dotnet-test/mtp para obtener más información.
Permite habilitar la salida de diagnóstico.
-
- error
- error
- Used when reporting directive errors like "file(location): error: message".
- Removed '{0}' directives ({1}) for '{2}' from: {3}Se eliminaron las directivas '{0}' ({1}) para '{2}' de: {3}
@@ -1226,11 +1216,6 @@ Make the profile names distinct.
Defina nombres de perfiles distintos.
-
- Duplicate directives are not supported: {0}
- No se admiten directivas duplicadas: {0}
- {0} is the directive type and name.
- duration:duración:
@@ -1586,11 +1571,6 @@ Defina nombres de perfiles distintos.
El método '{0}' no se cerró correctamente
-
- The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
- La directiva debe contener un nombre sin caracteres especiales y un valor opcional separado por "{1}" como "#:{0} Nombre{1}Valor".
- {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
- The specified file must exist and have '.cs' file extension: '{0}'El archivo especificado debe existir y tener la extensión de archivo ".cs": "{0}"
@@ -1606,11 +1586,6 @@ Defina nombres de perfiles distintos.
No se puede especificar la opción "{0}" cuando también se utiliza "-" para leer el archivo desde la entrada estándar.{0} is an option name like '--no-build'.
-
- The '#:project' directive is invalid: {0}
- La directiva "#:project" no es válida: {0}
- {0} is the inner error message.
- Failed to parse "{0}" as a semantic version.Error al analizar "{0}" como una versión semántica.
@@ -1748,11 +1723,6 @@ La herramienta "{1}" (versión "{2}") se instaló correctamente. Se ha agregado
Se recibió un nuevo protocolo de enlace "{0}" para la aplicación de prueba que no coincide con el protocolo de enlace anterior "{1}".
-
- Missing name of '{0}'.
- Falta el nombre de "{0}".
- {0} is the directive name like 'package' or 'sdk'.
- A test session start event was received without a corresponding test session end.Se recibió un evento de inicio de sesión de prueba sin un evento de finalización de sesión de prueba correspondiente.
@@ -2515,16 +2485,6 @@ La herramienta "{1}" (versión "{2}") se instaló correctamente. Se ha agregado
Proyectos
-
- Invalid property name: {0}
- Nombre de propiedad no válido {0}
- {0} is an inner exception message.
-
-
- The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
- La directiva de propiedad debe tener dos partes separadas por "=", como "#:property PropertyName=PropertyValue".
- {Locked="#:property"}
- Publisher for the .NET PlatformPublicador para la plataforma .NET
@@ -2567,11 +2527,6 @@ The default is to publish a framework-dependent application.
El valor predeterminado es publicar una aplicación dependiente del marco.
-
- Directives currently cannot contain double quotes (").
- Las directivas no pueden contener comillas dobles ("), por ahora.
-
- Shut down the Razor build server.Apaga el servidor de compilación de Razor.
@@ -3076,11 +3031,6 @@ Su proyecto tiene como destino varias plataformas. Especifique la que quiere usa
Salida estándar
-
- Static graph restore is not supported for file-based apps. Remove the '#:property'.
- No se admite la restauración de gráficos estáticos para aplicaciones basadas en archivos. Elimine "#:property".
- {Locked="#:property"}
- StatusEstado
@@ -3627,11 +3577,6 @@ y los identificadores de los paquetes correspondientes a las herramientas instal
Las filas con cambios sin registrar representan cambios de acciones distintas de los comandos de carga de trabajo de la CLI de .NET. Por lo general, esto representa una actualización del SDK de .NET o de Visual Studio.
-
- Unrecognized directive '{0}'.
- Directiva no reconocida "{0}".
- {0} is the directive name like 'package' or 'sdk'.
- Update all tools.Actualizar todas las herramientas.
diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.fr.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.fr.xlf
index f63c0cd0fe2c..99a477fb65ec 100644
--- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.fr.xlf
+++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.fr.xlf
@@ -184,11 +184,6 @@ Les chemins d’accès ont recherché : « {1} », « {2} ».
Impossible d’utiliser les options {0} et {1} ensemble. Supprimez l’une des options.
-
- Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
- Vous ne pouvez pas convertir certaines directives. Exécutez le fichier pour voir toutes les erreurs de compilation. Spécifiez « --force » pour convertir quand même.
- {Locked="--force"}
- Cannot find a tool in the manifest file that has a command named '{0}'.Outil introuvable dans le fichier manifeste comportant une commande nommée '{0}'.
@@ -1121,11 +1116,6 @@ Pour découvrir plus d’informations, consultez https://aka.ms/dotnet-test/mtp.
Active la sortie des diagnostics.
-
- error
- erreur
- Used when reporting directive errors like "file(location): error: message".
- Removed '{0}' directives ({1}) for '{2}' from: {3}Instructions « {0} » ({1}) supprimées pour « {2} » dans : {3}
@@ -1226,11 +1216,6 @@ Make the profile names distinct.
Faites en sorte que les noms de profil soient distincts.
-
- Duplicate directives are not supported: {0}
- Les directives dupliquées ne sont pas prises en charge : {0}
- {0} is the directive type and name.
- duration:durée :
@@ -1586,11 +1571,6 @@ Faites en sorte que les noms de profil soient distincts.
La méthode « {0} » ne s’est pas arrêtée correctement
-
- The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
- La directive dans doit contenir un nom sans caractères spéciaux et une valeur facultative séparée par « {1} » comme « # :{0} Nom{1}Valeur ».
- {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
- The specified file must exist and have '.cs' file extension: '{0}'Le fichier spécifié doit exister et avoir l'extension « .cs » : « {0} »
@@ -1606,11 +1586,6 @@ Faites en sorte que les noms de profil soient distincts.
Impossible de spécifier l’option « {0} » lorsque vous utilisez également '-' pour lire le fichier à partir de l’entrée standard.{0} is an option name like '--no-build'.
-
- The '#:project' directive is invalid: {0}
- La directive « #:project » n’est pas valide : {0}
- {0} is the inner error message.
- Failed to parse "{0}" as a semantic version.Échec de l’analyse de « {0} » en tant que version sémantique.
@@ -1748,11 +1723,6 @@ L'outil '{1}' (version '{2}') a été correctement installé. L'entrée est ajou
Une nouvelle négociation « {0} » a été reçue pour l’application de test, qui ne correspond pas à l’établissement d’une liaison précédente « {1} ».
-
- Missing name of '{0}'.
- Nom manquant pour « {0} ».
- {0} is the directive name like 'package' or 'sdk'.
- A test session start event was received without a corresponding test session end.Un événement de début de session de test a été reçu sans fin d’une session de test correspondante.
@@ -2515,16 +2485,6 @@ L'outil '{1}' (version '{2}') a été correctement installé. L'entrée est ajou
Projet(s)
-
- Invalid property name: {0}
- Nom de propriété non valide : {0}
- {0} is an inner exception message.
-
-
- The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
- La directive de propriété doit avoir deux parties séparées par '=' comme '#:property PropertyName=PropertyValue'.
- {Locked="#:property"}
- Publisher for the .NET PlatformÉditeur pour la plateforme .NET
@@ -2567,11 +2527,6 @@ The default is to publish a framework-dependent application.
La valeur par défaut est de publier une application dépendante du framework.
-
- Directives currently cannot contain double quotes (").
- Les directives ne peuvent actuellement pas contenir de guillemets doubles (").
-
- Shut down the Razor build server.Arrêtez le serveur de builds Razor.
@@ -3076,11 +3031,6 @@ Votre projet cible plusieurs frameworks. Spécifiez le framework à exécuter à
Sortie standard
-
- Static graph restore is not supported for file-based apps. Remove the '#:property'.
- La restauration de graphique statique n’est pas prise en charge pour les applications basées sur des fichiers. Supprimer la « #:property ».
- {Locked="#:property"}
- StatusÉtat
@@ -3627,11 +3577,6 @@ et les ID de package correspondants aux outils installés, utilisez la commande
Les lignes avec des modifications non enregistrées représentent les modifications des actions autres que les commandes de charge de travail CLI .NET. Il s’agit généralement d’une mise à jour du Kit de développement logiciel (SDK) .NET ou de Visual Studio.
-
- Unrecognized directive '{0}'.
- Directive « {0} » non reconnue.
- {0} is the directive name like 'package' or 'sdk'.
- Update all tools.Mettez à jour tous les outils.
diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.it.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.it.xlf
index 5266680cd426..be2ceadcebbe 100644
--- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.it.xlf
+++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.it.xlf
@@ -184,11 +184,6 @@ Percorsi cercati: '{1}', '{2}'.
Impossibile utilizzare contemporaneamente le opzioni {0} e {1}. Rimuove una delle opzioni.
-
- Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
- Non è possibile convertire alcune direttive. Eseguire il file per visualizzare tutti gli errori di compilazione. Specificare '--force' per eseguire comunque la conversione.
- {Locked="--force"}
- Cannot find a tool in the manifest file that has a command named '{0}'.Non è possibile trovare uno strumento nel file manifesto che include un comando denominato '{0}'.
@@ -1121,11 +1116,6 @@ Per altre informazioni, vedere https://aka.ms/dotnet-test/mtp.
Abilita l'output di diagnostica.
-
- error
- errore
- Used when reporting directive errors like "file(location): error: message".
- Removed '{0}' directives ({1}) for '{2}' from: {3}Sono state rimosse le direttive '{0}' ({1}) per '{2}' da: {3}
@@ -1226,11 +1216,6 @@ Make the profile names distinct.
Rendi distinti i nomi profilo.
-
- Duplicate directives are not supported: {0}
- Le direttive duplicate non supportate: {0}
- {0} is the directive type and name.
- duration:durata:
@@ -1586,11 +1571,6 @@ Rendi distinti i nomi profilo.
Il metodo '{0}' non è stato chiuso correttamente
-
- The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
- La direttiva deve contenere un nome senza caratteri speciali e un valore facoltativo delimitato da '{1}' come '#:{0}Nome {1}Valore'.
- {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
- The specified file must exist and have '.cs' file extension: '{0}'Il file specificato deve esistere e avere l'estensione '.cs': '{0}'
@@ -1606,11 +1586,6 @@ Rendi distinti i nomi profilo.
Non è possibile specificare l'opzione '{0}' quando si utilizza anche '-' per leggere il file dall'input standard.{0} is an option name like '--no-build'.
-
- The '#:project' directive is invalid: {0}
- La direttiva '#:project' non è valida: {0}
- {0} is the inner error message.
- Failed to parse "{0}" as a semantic version.Non è stato possibile analizzare "{0}" come versione semantica.
@@ -1748,11 +1723,6 @@ Lo strumento '{1}' versione '{2}' è stato installato. La voce è stata aggiunta
È stato ricevuto un nuovo handshake '{0}' per l'applicazione di test che non corrisponde all'handshake precedente '{1}'.
-
- Missing name of '{0}'.
- Manca il nome di '{0}'.
- {0} is the directive name like 'package' or 'sdk'.
- A test session start event was received without a corresponding test session end.È stato ricevuto un evento di inizio sessione di test senza un evento di fine sessione corrispondente.
@@ -2515,16 +2485,6 @@ Lo strumento '{1}' versione '{2}' è stato installato. La voce è stata aggiunta
Progetto/i
-
- Invalid property name: {0}
- Nome proprietà non valido: {0}
- {0} is an inner exception message.
-
-
- The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
- La direttiva di proprietà deve avere due parti delimitate da '=', come '#:property PropertyName=PropertyValue'.
- {Locked="#:property"}
- Publisher for the .NET PlatformEditore per la piattaforma .NET
@@ -2567,11 +2527,6 @@ The default is to publish a framework-dependent application.
Per impostazione predefinita, viene generato un pacchetto dipendente dal framework.
-
- Directives currently cannot contain double quotes (").
- Le direttive attualmente non possono contenere virgolette doppie (").
-
- Shut down the Razor build server.Arresta il server di compilazione di Razor.
@@ -3076,11 +3031,6 @@ Il progetto è destinato a più framework. Specificare il framework da eseguire
Output standard
-
- Static graph restore is not supported for file-based apps. Remove the '#:property'.
- Il ripristino statico del grafo non è supportato per le app basate su file. Rimuovere '#:property'.
- {Locked="#:property"}
- StatusStato
@@ -3627,11 +3577,6 @@ e gli ID pacchetto corrispondenti per gli strumenti installati usando il comando
Le righe con modifiche non registrate rappresentano modifiche da azioni diverse dai comandi del carico di lavoro dell'interfaccia della riga di comando .NET. In genere si tratta di un aggiornamento di .NET SDK o di Visual Studio.
-
- Unrecognized directive '{0}'.
- Direttiva non riconosciuta '{0}'.
- {0} is the directive name like 'package' or 'sdk'.
- Update all tools.Aggiorna tutti gli strumenti.
diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ja.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ja.xlf
index 4792f3300c2f..c2b71ed739c3 100644
--- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ja.xlf
+++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ja.xlf
@@ -184,11 +184,6 @@ Paths searched: '{1}', '{2}'.
{0} オプションと {1} オプションを同時に使用することはできません。いずれかのオプションを削除してください。
-
- Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
- 一部のディレクティブは変換できません。ファイルを実行して、すべてのコンパイル エラーを表示します。それでも変換する場合は '--force' を指定してください。
- {Locked="--force"}
- Cannot find a tool in the manifest file that has a command named '{0}'.'{0}' という名前のコマンドを持つマニフェスト ファイルでツールが見つかりません。
@@ -1121,11 +1116,6 @@ See https://aka.ms/dotnet-test/mtp for more information.
診断出力を有効にします。
-
- error
- エラー
- Used when reporting directive errors like "file(location): error: message".
- Removed '{0}' directives ({1}) for '{2}' from: {3}'{2}' の '{0}' ディレクティブ ({1}) を次から削除しました: {3}
@@ -1226,11 +1216,6 @@ Make the profile names distinct.
プロファイル名を区別できるようにしてください。
-
- Duplicate directives are not supported: {0}
- 重複するディレクティブはサポートされていません: {0}
- {0} is the directive type and name.
- duration:期間:
@@ -1586,11 +1571,6 @@ Make the profile names distinct.
メソッド '{0}' が正常に終了しませんでした
-
- The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
- ディレクティブには、特殊文字を含まない名前と、'#:{0} Name{1}Value' などの '{1}' で区切られた省略可能な値を含める必要があります。
- {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
- The specified file must exist and have '.cs' file extension: '{0}'指定されたファイルが存在し、ファイル拡張子が '.cs' である必要があります: '{0}'
@@ -1606,11 +1586,6 @@ Make the profile names distinct.
標準入力からファイルを読み取るために '-' も使用している場合は、オプション '{0}' を指定できません。{0} is an option name like '--no-build'.
-
- The '#:project' directive is invalid: {0}
- '#:p roject' ディレクティブが無効です: {0}
- {0} is the inner error message.
- Failed to parse "{0}" as a semantic version."{0}" をセマンティック バージョンとして解析できませんでした。
@@ -1748,11 +1723,6 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man
テスト アプリケーションに対して、前回のハンドシェイク '{0}' と一致しない新しいハンドシェイク '{1}' を受信しました。
-
- Missing name of '{0}'.
- '{0}' の名前がありません。
- {0} is the directive name like 'package' or 'sdk'.
- A test session start event was received without a corresponding test session end.対応するテスト セッションの終了がないまま、テスト セッション開始イベントを受信しました。
@@ -2515,16 +2485,6 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man
プロジェクト
-
- Invalid property name: {0}
- 無効なプロパティ名: {0}
- {0} is an inner exception message.
-
-
- The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
- プロパティ ディレクティブには、'#:property PropertyName=PropertyValue' のように '=' で区切られた 2 つの部分が必要です。
- {Locked="#:property"}
- Publisher for the .NET Platform.NET Platform 用パブリッシャー
@@ -2567,11 +2527,6 @@ The default is to publish a framework-dependent application.
既定では、フレームワークに依存したアプリケーションが公開されます。
-
- Directives currently cannot contain double quotes (").
- ディレクティブには二重引用符 (") を含めることはできません。
-
- Shut down the Razor build server.Razor ビルド サーバーをシャットダウンします。
@@ -3076,11 +3031,6 @@ Your project targets multiple frameworks. Specify which framework to run using '
標準出力
-
- Static graph restore is not supported for file-based apps. Remove the '#:property'.
- 静的グラフの復元はファイルベースのアプリではサポートされていません。'#:property' を削除します。
- {Locked="#:property"}
- Status状態
@@ -3627,11 +3577,6 @@ and the corresponding package Ids for installed tools using the command
ログに記録されていない変更がある行は、.NET CLI ワークロード コマンド以外のアクションからの変更を表します。通常、これは .NET SDK または Visual Studio の更新を表します。
-
- Unrecognized directive '{0}'.
- 認識されないディレクティブ '{0}' です。
- {0} is the directive name like 'package' or 'sdk'.
- Update all tools.すべてのツールを更新する。
diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ko.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ko.xlf
index a64e9bda557c..d81b9d245054 100644
--- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ko.xlf
+++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ko.xlf
@@ -184,11 +184,6 @@ Paths searched: '{1}', '{2}'.
{0} 및 {1} 옵션을 함께 사용할 수 없습니다. 옵션 중 하나를 제거하세요.
-
- Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
- 일부 지시문을 변환할 수 없습니다. 파일을 실행하여 모든 컴파일 오류를 확인하세요. 변환을 강제로 진행하려면 '--force'를 지정하세요.
- {Locked="--force"}
- Cannot find a tool in the manifest file that has a command named '{0}'.이름이 '{0}'인 명령이 있는 매니페스트 파일에서 도구를 찾을 수 없습니다.
@@ -1121,11 +1116,6 @@ See https://aka.ms/dotnet-test/mtp for more information.
진단 출력을 사용하도록 설정합니다.
-
- error
- 오류
- Used when reporting directive errors like "file(location): error: message".
- Removed '{0}' directives ({1}) for '{2}' from: {3}다음에서 '{2}'에 대한 '{0}' 지시문({1})을 제거했습니다. {3}
@@ -1226,11 +1216,6 @@ Make the profile names distinct.
고유한 프로필 이름을 사용하세요.
-
- Duplicate directives are not supported: {0}
- 중복 지시문은 지원되지 않습니다. {0}
- {0} is the directive type and name.
- duration:기간:
@@ -1586,11 +1571,6 @@ Make the profile names distinct.
'{0}' 메서드가 성공적으로 종료되지 않았습니다.
-
- The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
- 지시문에는 특수 문자가 없는 이름과 '#:{0} 이름{1}값'과 같이 '{1}'(으)로 구분된 선택적 값이 포함되어야 합니다.
- {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
- The specified file must exist and have '.cs' file extension: '{0}'지정한 파일이 존재해야 하며 '.cs' 파일 확장명이 있어야 합니다. '{0}'.
@@ -1606,11 +1586,6 @@ Make the profile names distinct.
'-'를 사용하여 표준 입력에서 파일을 읽는 경우에도 '{0}' 옵션을 지정할 수 없습니다.{0} is an option name like '--no-build'.
-
- The '#:project' directive is invalid: {0}
- '#:p roject' 지시문이 잘못되었습니다. {0}
- {0} is the inner error message.
- Failed to parse "{0}" as a semantic version.'{0}'을(를) 의미 체계 버전으로 구문 분석하지 못했습니다.
@@ -1748,11 +1723,6 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man
이전 핸드셰이크 '{1}'과(와) 일치하지 않는 테스트 애플리케이션에 대해 새 핸드셰이크 '{0}'이(가) 수신되었습니다.
-
- Missing name of '{0}'.
- '{0}' 이름이 없습니다.
- {0} is the directive name like 'package' or 'sdk'.
- A test session start event was received without a corresponding test session end.해당 테스트 세션 종료 없이 테스트 세션 시작 이벤트를 받았습니다.
@@ -2515,16 +2485,6 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man
프로젝트
-
- Invalid property name: {0}
- 잘못된 속성 이름: {0}
- {0} is an inner exception message.
-
-
- The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
- property 지시문에는 '#:property PropertyName=PropertyValue'와 같이 '='로 구분된 두 부분이 있어야 합니다.
- {Locked="#:property"}
- Publisher for the .NET Platform.NET 플랫폼용 게시자입니다.
@@ -2567,11 +2527,6 @@ The default is to publish a framework-dependent application.
기본값은 프레임워크 종속 애플리케이션을 게시하는 것입니다.
-
- Directives currently cannot contain double quotes (").
- 지시문은 현재 큰따옴표(")를 포함할 수 없습니다.
-
- Shut down the Razor build server.Razor 빌드 서버를 종료합니다.
@@ -3076,11 +3031,6 @@ Your project targets multiple frameworks. Specify which framework to run using '
표준 출력
-
- Static graph restore is not supported for file-based apps. Remove the '#:property'.
- 정적 그래프 복원은 파일 기반 앱에서 지원되지 않습니다. '#:property'를 제거합니다.
- {Locked="#:property"}
- Status상태
@@ -3627,11 +3577,6 @@ and the corresponding package Ids for installed tools using the command
기록되지 않은 변경 내용이 있는 행은 .NET CLI 워크로드 명령 이외의 작업에서 변경된 사항을 나타냅니다. 이러한 변경 사항은 일반적으로 .NET SDK 또는 Visual Studio에 대한 업데이트를 나타냅니다.
-
- Unrecognized directive '{0}'.
- 인식할 수 없는 지시문 '{0}'입니다.
- {0} is the directive name like 'package' or 'sdk'.
- Update all tools.모든 도구를 업데이트합니다.
diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pl.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pl.xlf
index f00071279f4f..53e80c56a085 100644
--- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pl.xlf
+++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pl.xlf
@@ -184,11 +184,6 @@ Przeszukane ścieżki: „{1}”, „{2}”.
Nie można używać opcji {0} i {1} razem. Usuń jedną z opcji.
-
- Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
- Nie można przekonwertować niektórych dyrektyw. Uruchom plik, aby wyświetlić wszystkie błędy kompilacji. Określ element „--force”, aby mimo to przekonwertować.
- {Locked="--force"}
- Cannot find a tool in the manifest file that has a command named '{0}'.Nie można odnaleźć narzędzia w pliku manifestu, które zawiera polecenie o nazwie „{0}”.
@@ -1121,11 +1116,6 @@ Aby uzyskać więcej informacji, zobacz https://aka.ms/dotnet-test/mtp.
Włącza dane wyjściowe diagnostyki.
-
- error
- błąd
- Used when reporting directive errors like "file(location): error: message".
- Removed '{0}' directives ({1}) for '{2}' from: {3}Usunięto dyrektywy „{0}” ({1}) dla „{2}” z pliku: {3}
@@ -1226,11 +1216,6 @@ Make the profile names distinct.
Rozróżnij nazwy profilów.
-
- Duplicate directives are not supported: {0}
- Zduplikowane dyrektywy nie są obsługiwane: {0}
- {0} is the directive type and name.
- duration:czas trwania:
@@ -1586,11 +1571,6 @@ Rozróżnij nazwy profilów.
Metoda „{0}” nie zakończyła się pomyślnie
-
- The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
- Dyrektywa powinna zawierać nazwę bez znaków specjalnych i opcjonalną wartość rozdzieloną znakiem "{1}#:{0} Name{1}Value".
- {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
- The specified file must exist and have '.cs' file extension: '{0}'Określony plik musi istnieć i mieć rozszerzenie pliku „.cs”: „{0}”
@@ -1606,11 +1586,6 @@ Rozróżnij nazwy profilów.
Nie można określić opcji „{0}” przy jednoczesnym używaniu znaku „-” do odczytu pliku ze standardowych danych wejściowych.{0} is an option name like '--no-build'.
-
- The '#:project' directive is invalid: {0}
- Dyrektywa „#:project” jest nieprawidłowa: {0}
- {0} is the inner error message.
- Failed to parse "{0}" as a semantic version.Nie można przeanalizować ciągu „{0}” jako wersji semantycznej.
@@ -1748,11 +1723,6 @@ Narzędzie „{1}” (wersja „{2}”) zostało pomyślnie zainstalowane. Wpis
Odebrano nowe uzgadnianie „{0}” dla aplikacji testowej, która nie pasuje do poprzedniego uzgadniania „{1}”.
-
- Missing name of '{0}'.
- Brak nazwy „{0}”.
- {0} is the directive name like 'package' or 'sdk'.
- A test session start event was received without a corresponding test session end.Odebrano zdarzenie rozpoczęcia sesji testowej bez odpowiedniego zakończenia sesji testowej.
@@ -2515,16 +2485,6 @@ Narzędzie „{1}” (wersja „{2}”) zostało pomyślnie zainstalowane. Wpis
Projekty
-
- Invalid property name: {0}
- Nieprawidłowa nazwa właściwości: {0}
- {0} is an inner exception message.
-
-
- The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
- Dyrektywa właściwości musi mieć dwie części oddzielone znakiem „=”, na przykład „#:property PropertyName=PropertyValue”.
- {Locked="#:property"}
- Publisher for the .NET PlatformWydawca dla platformy .NET.
@@ -2567,11 +2527,6 @@ The default is to publish a framework-dependent application.
Domyślnie publikowana jest aplikacja zależna od struktury.
-
- Directives currently cannot contain double quotes (").
- Dyrektywy nie mogą obecnie zawierać podwójnych cudzysłowów (").
-
- Shut down the Razor build server.Zamknij serwer kompilacji Razor.
@@ -3076,11 +3031,6 @@ Projekt ma wiele platform docelowych. Określ platformę do uruchomienia przy u
Standardowe dane wyjściowe
-
- Static graph restore is not supported for file-based apps. Remove the '#:property'.
- Przywracanie statycznego grafu nie jest obsługiwane w przypadku aplikacji opartych na plikach. Usuń element „#:property”.
- {Locked="#:property"}
- StatusStan
@@ -3627,11 +3577,6 @@ i odpowiednie identyfikatory pakietów zainstalowanych narzędzi można znaleź
Wiersze z niezarejestrowanymi zmianami reprezentują zmiany pochodzące z akcji innych niż polecenia obciążenia interfejsu wiersza polecenia platformy .NET. Zazwyczaj oznacza to aktualizację zestawu .NET SDK lub programu Visual Studio.
-
- Unrecognized directive '{0}'.
- Nierozpoznana dyrektywa „{0}”.
- {0} is the directive name like 'package' or 'sdk'.
- Update all tools.Zaktualizuj wszystkie narzędzia.
diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pt-BR.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pt-BR.xlf
index 1df2278364f0..f399a9de6b54 100644
--- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pt-BR.xlf
+++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pt-BR.xlf
@@ -184,11 +184,6 @@ Caminhos pesquisados: "{1}", "{2}".
Não é possível usar as opções {0} e {1} juntas. Escolha uma das opções.
-
- Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
- Algumas diretivas não podem ser convertidas. Execute o arquivo para ver todos os erros de compilação. Especifique '--force' para converter mesmo assim.
- {Locked="--force"}
- Cannot find a tool in the manifest file that has a command named '{0}'.Não é possível localizar uma ferramenta no arquivo de manifesto com um comando chamado '{0}'.
@@ -1121,11 +1116,6 @@ Consulte https://aka.ms/dotnet-test/mtp para obter mais informações.
Habilita a saída de diagnóstico.
-
- error
- erro
- Used when reporting directive errors like "file(location): error: message".
- Removed '{0}' directives ({1}) for '{2}' from: {3}Diretivas "{0}" removidas ({1}) para "{2}" de: {3}
@@ -1226,11 +1216,6 @@ Make the profile names distinct.
Diferencie os nomes dos perfis.
-
- Duplicate directives are not supported: {0}
- Diretivas duplicadas não são suportadas:{0}
- {0} is the directive type and name.
- duration:duração:
@@ -1586,11 +1571,6 @@ Diferencie os nomes dos perfis.
O método '{0}' não foi concluído com sucesso
-
- The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
- A diretiva deve conter um nome sem caracteres especiais e um valor opcional separado por '{1}' como '#:{0} Nome{1}Valor'.
- {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
- The specified file must exist and have '.cs' file extension: '{0}'O arquivo especificado deve existir e ter a extensão de arquivo ".cs": "{0}"
@@ -1606,11 +1586,6 @@ Diferencie os nomes dos perfis.
Não é possível especificar a opção '{0}' ao mesmo tempo em que se utiliza '-' para ler o arquivo da entrada padrão.{0} is an option name like '--no-build'.
-
- The '#:project' directive is invalid: {0}
- A diretiva '#:project' é inválida:{0}
- {0} is the inner error message.
- Failed to parse "{0}" as a semantic version.Falha ao analisar "{0}" como uma versão semântica.
@@ -1748,11 +1723,6 @@ A ferramenta '{1}' (versão '{2}') foi instalada com êxito. A entrada foi adici
Um novo handshake '{0}' foi recebido para o aplicativo de teste que não corresponde ao handshake anterior '{1}'.
-
- Missing name of '{0}'.
- Nome de '{0}' ausente.
- {0} is the directive name like 'package' or 'sdk'.
- A test session start event was received without a corresponding test session end.Um evento de início de sessão de teste foi recebido sem um término de sessão de teste correspondente.
@@ -2515,16 +2485,6 @@ A ferramenta '{1}' (versão '{2}') foi instalada com êxito. A entrada foi adici
Projetos
-
- Invalid property name: {0}
- Nome de propriedade inválido: {0}
- {0} is an inner exception message.
-
-
- The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
- A diretiva de propriedade precisa ter duas partes separadas por '=' como '#:property PropertyName=PropertyValue'.
- {Locked="#:property"}
- Publisher for the .NET PlatformEditor para a Plataforma .NET
@@ -2567,11 +2527,6 @@ The default is to publish a framework-dependent application.
O padrão é publicar uma aplicação dependente de framework.
-
- Directives currently cannot contain double quotes (").
- No momento, as diretivas não podem conter aspas duplas (").
-
- Shut down the Razor build server.Desligar o servidor de build do Razor.
@@ -3076,11 +3031,6 @@ Ele tem diversas estruturas como destino. Especifique que estrutura executar usa
Saída padrão
-
- Static graph restore is not supported for file-based apps. Remove the '#:property'.
- A restauração de grafo estático não é suportada para aplicativos baseados em arquivos. Remova '#:property'.
- {Locked="#:property"}
- StatusStatus
@@ -3627,11 +3577,6 @@ e as Ids de pacote correspondentes para as ferramentas instaladas usando o coman
As linhas com as alterações Não Registradas representam as alterações de ações diferentes dos comandos de carga de trabalho da CLI do .NET. Geralmente, isso representa uma atualização para o SDK do .NET ou para o Visual Studio.
-
- Unrecognized directive '{0}'.
- Diretiva não reconhecida '{0}'.
- {0} is the directive name like 'package' or 'sdk'.
- Update all tools.Atualize todas as ferramentas.
diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ru.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ru.xlf
index ac72cd0ab5a1..9d5441ace524 100644
--- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ru.xlf
+++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ru.xlf
@@ -184,11 +184,6 @@ Paths searched: '{1}', '{2}'.
Невозможно использовать параметры {0} и {1} одновременно. Удалите один из параметров.
-
- Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
- Некоторые директивы невозможно преобразовать. Запустите файл, чтобы увидеть все ошибки компиляции. Укажите параметр "--force", чтобы выполнить преобразование, невзирая на ошибки.
- {Locked="--force"}
- Cannot find a tool in the manifest file that has a command named '{0}'.Не удается найти средство в файле манифеста, который содержит команду с именем "{0}".
@@ -1121,11 +1116,6 @@ See https://aka.ms/dotnet-test/mtp for more information.
Включает диагностические выходные данные.
-
- error
- ошибка
- Used when reporting directive errors like "file(location): error: message".
- Removed '{0}' directives ({1}) for '{2}' from: {3}Удалены директивы "{0}" ({1}) для "{2}" из: {3}
@@ -1226,11 +1216,6 @@ Make the profile names distinct.
Сделайте имена профилей разными.
-
- Duplicate directives are not supported: {0}
- Повторяющиеся директивы не поддерживаются: {0}
- {0} is the directive type and name.
- duration:длительность:
@@ -1586,11 +1571,6 @@ Make the profile names distinct.
Сбой выхода метода "{0}"
-
- The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
- Директива должна содержать имя без специальных символов и необязательное значение, разделенные символом-разделителем "{1}", например "#:{0} Имя{1}Значение".
- {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
- The specified file must exist and have '.cs' file extension: '{0}'Указанный файл должен существовать и иметь расширение ".cs": "{0}"
@@ -1606,11 +1586,6 @@ Make the profile names distinct.
Невозможно указать параметр "{0}", если также используется "-" для чтения файла из стандартного ввода.{0} is an option name like '--no-build'.
-
- The '#:project' directive is invalid: {0}
- Недопустимая директива "#:project": {0}
- {0} is the inner error message.
- Failed to parse "{0}" as a semantic version.Не удалось выполнить разбор "{0}" как семантической версии.
@@ -1748,11 +1723,6 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man
Получено новое подтверждение "{0}" для тестового приложения, которое не совпадает с предыдущим подтверждением "{1}".
-
- Missing name of '{0}'.
- Отсутствует имя "{0}".
- {0} is the directive name like 'package' or 'sdk'.
- A test session start event was received without a corresponding test session end.Получено событие запуска тестового сеанса без соответствующего завершения тестового сеанса.
@@ -2515,16 +2485,6 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man
Проекты
-
- Invalid property name: {0}
- Недопустимое имя свойства: {0}
- {0} is an inner exception message.
-
-
- The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
- Директива свойства должна иметь две части, разделенные символом "=", например "#:property PropertyName=PropertyValue".
- {Locked="#:property"}
- Publisher for the .NET PlatformИздатель для платформы .NET
@@ -2567,11 +2527,6 @@ The default is to publish a framework-dependent application.
По умолчанию публикация выполняется в приложение, зависимое от платформы.
-
- Directives currently cannot contain double quotes (").
- В директивах пока нельзя использовать двойные кавычки (").
-
- Shut down the Razor build server.Завершает работу сервера сборки Razor.
@@ -3076,11 +3031,6 @@ Your project targets multiple frameworks. Specify which framework to run using '
Стандартный вывод
-
- Static graph restore is not supported for file-based apps. Remove the '#:property'.
- Восстановление статического графа не поддерживается для приложений на основе файлов. Удалите "#:property".
- {Locked="#:property"}
- StatusСостояние
@@ -3628,11 +3578,6 @@ and the corresponding package Ids for installed tools using the command
Строки с нерегистрируемыми в журнале изменениями представляют изменения из действий, отличных от команд рабочей нагрузки .NET CLI. Обычно это представляет обновление пакета SDK для .NET или Visual Studio.
-
- Unrecognized directive '{0}'.
- Нераспознанная директива "{0}".
- {0} is the directive name like 'package' or 'sdk'.
- Update all tools.Обновление всех инструментов.
diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.tr.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.tr.xlf
index 43cc59b2d709..80ed9a3e2911 100644
--- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.tr.xlf
+++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.tr.xlf
@@ -184,11 +184,6 @@ Aranan yollar: '{1}', '{2}'.
{0} ve {1} seçenekleri birlikte kullanılamaz. Seçeneklerden birini kaldırın.
-
- Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
- Bazı yönergeler dönüştürülemez. Tüm derleme hatalarını görmek için dosyayı çalıştırın. Yine de dönüştürmek için '--force' belirtin.
- {Locked="--force"}
- Cannot find a tool in the manifest file that has a command named '{0}'.Bildirim dosyasında komut adı '{0}' olan bir araç bulunamıyor.
@@ -1121,11 +1116,6 @@ Daha fazla bilgi için https://aka.ms/dotnet-test/mtp adresine bakın.
Tanılama çıkışı sağlar.
-
- error
- hata
- Used when reporting directive errors like "file(location): error: message".
- Removed '{0}' directives ({1}) for '{2}' from: {3}‘{2}’ için ‘{0}’ yönergeleri ({1}) şuradan kaldırıldı: {3}
@@ -1226,11 +1216,6 @@ Make the profile names distinct.
Lütfen profil adlarını değiştirin.
-
- Duplicate directives are not supported: {0}
- Yinelenen yönergeler desteklenmez: {0}
- {0} is the directive type and name.
- duration:süre:
@@ -1586,11 +1571,6 @@ Lütfen profil adlarını değiştirin.
'{0}' yöntemi başarıyla çıkmadı
-
- The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
- Yönerge, özel karakterler içermeyen bir ad ve ‘#:{0} Ad{1}Değer’ gibi '{1}' ile ayrılmış isteğe bağlı bir değer içermelidir.
- {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
- The specified file must exist and have '.cs' file extension: '{0}'Belirtilen dosya mevcut olmalıdır ve uzantısı '.cs' olmalıdır: '{0}'
@@ -1606,11 +1586,6 @@ Lütfen profil adlarını değiştirin.
Standart girişten dosyayı okumak için ‘-’ kullanırken '{0}' seçeneği belirtilemez.{0} is an option name like '--no-build'.
-
- The '#:project' directive is invalid: {0}
- ‘#:project’ yönergesi geçersizdir: {0}
- {0} is the inner error message.
- Failed to parse "{0}" as a semantic version.'{0}' bir anlamsal sürüm olarak ayrıştırılamadı.
@@ -1748,11 +1723,6 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man
Test uygulaması için önceki el sıkışma '{1}' ile eşleşmeyen yeni bir el sıkışma '{0}' alındı.
-
- Missing name of '{0}'.
- '{0}' adı eksik.
- {0} is the directive name like 'package' or 'sdk'.
- A test session start event was received without a corresponding test session end.Karşılık gelen test oturumu sonu olmadan bir test oturumu başlangıç olayı alındı.
@@ -2515,16 +2485,6 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man
Projeler
-
- Invalid property name: {0}
- Geçersiz özellik adı: {0}
- {0} is an inner exception message.
-
-
- The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
- Özellik yönergesi, ‘#:property PropertyName=PropertyValue’ gibi ‘=’ ile ayrılmış iki bölümden oluşmalıdır.
- {Locked="#:property"}
- Publisher for the .NET Platform.NET Platformunun yayımcısı.
@@ -2567,11 +2527,6 @@ The default is to publish a framework-dependent application.
Varsayılan durum, çerçeveye bağımlı bir uygulama yayımlamaktır.
-
- Directives currently cannot contain double quotes (").
- Yönergeler şu anda çift tırnak (") içeremez.
-
- Shut down the Razor build server.Razor derleme sunucusunu kapatır.
@@ -3076,11 +3031,6 @@ Projeniz birden fazla Framework'ü hedefliyor. '{0}' kullanarak hangi Framework'
Standart çıkış
-
- Static graph restore is not supported for file-based apps. Remove the '#:property'.
- Dosya tabanlı uygulamalar için statik grafik geri yükleme desteklenmemektedir. ‘#:property’i kaldırın.
- {Locked="#:property"}
- StatusDurum
@@ -3627,11 +3577,6 @@ karşılık gelen paket kimliklerini bulmak için
Kaydedilmemiş değişiklikler içeren satırlar, .NET CLI iş yükü komutları dışındaki eylemlerden kaynaklanan değişiklikleri temsil eder. Bu genellikle .NET SDK'ya veya Visual Studio'ya bir güncelleştirme anlamına gelir.
-
- Unrecognized directive '{0}'.
- Tanınmayan yönerge '{0}'.
- {0} is the directive name like 'package' or 'sdk'.
- Update all tools.Tüm araçları güncelleştirin.
diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hans.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hans.xlf
index 917ddc8a0736..03d45dfee890 100644
--- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hans.xlf
+++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hans.xlf
@@ -184,11 +184,6 @@ Paths searched: '{1}', '{2}'.
不能同时使用 {0} 和 {1} 选项。移除其中一个选项。
-
- Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
- 一些指令无法转换。运行该文件以查看所有编译错误。请指定 '--force' 以进行转换。
- {Locked="--force"}
- Cannot find a tool in the manifest file that has a command named '{0}'.在清单文件中找不到命令名为“{0}”的工具。
@@ -1121,11 +1116,6 @@ See https://aka.ms/dotnet-test/mtp for more information.
启用诊断输出。
-
- error
- 错误
- Used when reporting directive errors like "file(location): error: message".
- Removed '{0}' directives ({1}) for '{2}' from: {3}已从 {3} 移除“{2}”的“{0}”指令({1})
@@ -1226,11 +1216,6 @@ Make the profile names distinct.
将配置文件名称设为可区分的名称。
-
- Duplicate directives are not supported: {0}
- 不支持重复指令: {0}
- {0} is the directive type and name.
- duration:持续时间:
@@ -1586,11 +1571,6 @@ Make the profile names distinct.
方法“{0}”未成功退出
-
- The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
- 该指令应包含一个不带特殊字符的名称,以及一个以 '#:{0} Name{1}Value' 等 ‘{1}’ 分隔的可选值。
- {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
- The specified file must exist and have '.cs' file extension: '{0}'指定的文件必须存在且具有 ‘.cs’ 文件扩展名: ‘{0}’
@@ -1606,11 +1586,6 @@ Make the profile names distinct.
当还使用 ‘-’ 从标准输入中读取文件时,无法指定选项 ‘{0}’。{0} is an option name like '--no-build'.
-
- The '#:project' directive is invalid: {0}
- '#:project' 指令无效: {0}
- {0} is the inner error message.
- Failed to parse "{0}" as a semantic version.无法将 ‘{0}’ 分析为语义版本。
@@ -1748,11 +1723,6 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man
测试应用程序收到了新的握手 ‘{0}’,它与以前的握手 ‘{1}’ 不匹配。
-
- Missing name of '{0}'.
- 缺少 '{0}' 的名称。
- {0} is the directive name like 'package' or 'sdk'.
- A test session start event was received without a corresponding test session end.在没有相应的测试会话结束的情况下收到了测试会话开始事件。
@@ -2515,16 +2485,6 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man
项目
-
- Invalid property name: {0}
- 属性名无效: {0}
- {0} is an inner exception message.
-
-
- The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
- 属性指令需要包含两个由 ‘=’ 分隔的部件,例如 '#:property PropertyName=PropertyValue'。
- {Locked="#:property"}
- Publisher for the .NET Platform适用于 .NET 平台的发布服务器
@@ -2567,11 +2527,6 @@ The default is to publish a framework-dependent application.
默认情况下发布依赖于框架的应用程序。
-
- Directives currently cannot contain double quotes (").
- 指令当前不能包含双引号(")。
-
- Shut down the Razor build server.关闭 Razor 生成服务器。
@@ -3076,11 +3031,6 @@ Your project targets multiple frameworks. Specify which framework to run using '
标准输出
-
- Static graph restore is not supported for file-based apps. Remove the '#:property'.
- 基于文件的应用不支持静态图形还原。移除 '#:property'。
- {Locked="#:property"}
- Status状态
@@ -3627,11 +3577,6 @@ and the corresponding package Ids for installed tools using the command
具有未记录更改的行表示除 .NET CLI 工作负载命令以外的操作的更改。这通常表示对 .NET SDK 或 Visual Studio 的更新。
-
- Unrecognized directive '{0}'.
- 无法识别的指令 ‘{0}’。
- {0} is the directive name like 'package' or 'sdk'.
- Update all tools.更新所有工具。
diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hant.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hant.xlf
index 95c9e8011346..a0c1dadc548d 100644
--- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hant.xlf
+++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hant.xlf
@@ -184,11 +184,6 @@ Paths searched: '{1}', '{2}'.
無法同時使用 {0} 與 {1} 選項。移除其中一個選項。
-
- Some directives cannot be converted. Run the file to see all compilation errors. Specify '--force' to convert anyway.
- 無法轉換某些指示詞。執行檔案以查看所有編譯錯誤。指定 '--force' 以繼續轉換。
- {Locked="--force"}
- Cannot find a tool in the manifest file that has a command named '{0}'.在資訊清單中找不到有名稱 '{0}' 命令的工具。
@@ -1121,11 +1116,6 @@ See https://aka.ms/dotnet-test/mtp for more information.
啟用診斷輸出。
-
- error
- 錯誤
- Used when reporting directive errors like "file(location): error: message".
- Removed '{0}' directives ({1}) for '{2}' from: {3}已從 {3} 移除 '{2}' 的 '{0}' 指令 ({1})
@@ -1226,11 +1216,6 @@ Make the profile names distinct.
請讓設定檔名稱相異。
-
- Duplicate directives are not supported: {0}
- 不支援重複的指示詞: {0}
- {0} is the directive type and name.
- duration:期間:
@@ -1586,11 +1571,6 @@ Make the profile names distinct.
方法 '{0}' 未成功結束
-
- The directive should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'.
- 指示詞應包含不含特殊字元的名稱,以及 '{1}' 分隔的選用值,例如 '#:{0} Name{1}Value'。
- {0} is the directive type like 'package' or 'sdk'. {1} is the expected separator like '@' or '='.
- The specified file must exist and have '.cs' file extension: '{0}'指定的檔案必須存在,並具有 '.cs' 副檔名:'{0}'
@@ -1606,11 +1586,6 @@ Make the profile names distinct.
當使用「-」從標準輸入讀取檔案時,無法指定選項 '{0}'。{0} is an option name like '--no-build'.
-
- The '#:project' directive is invalid: {0}
- '#:project' 指示詞無效: {0}
- {0} is the inner error message.
- Failed to parse "{0}" as a semantic version.無法將 '{0}' 剖析為語意版本。
@@ -1748,11 +1723,6 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man
測試應用程式收到新的交握 '{0}',與先前的交握 '{1}' 不相符。
-
- Missing name of '{0}'.
- 缺少 '{0}' 的名稱。
- {0} is the directive name like 'package' or 'sdk'.
- A test session start event was received without a corresponding test session end.收到測試工作階段開始事件,但沒有對應的測試工作階段結束。
@@ -2515,16 +2485,6 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man
專案
-
- Invalid property name: {0}
- 屬性名稱無效: {0}
- {0} is an inner exception message.
-
-
- The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue'.
- 屬性指示詞必須有兩個部分,其以 '=' 分隔,例如 '#:property PropertyName=PropertyValue'。
- {Locked="#:property"}
- Publisher for the .NET Platform.NET 平台的發行者
@@ -2567,11 +2527,6 @@ The default is to publish a framework-dependent application.
預設為發佈與 Framework 相依的應用程式。
-
- Directives currently cannot contain double quotes (").
- 指令目前不能包含雙引號 (")。
-
- Shut down the Razor build server.關閉 Razor 組建伺服器。
@@ -3076,11 +3031,6 @@ Your project targets multiple frameworks. Specify which framework to run using '
標準輸出
-
- Static graph restore is not supported for file-based apps. Remove the '#:property'.
- 檔案型應用程式不支援靜態圖表還原。移除 ''#:property'。
- {Locked="#:property"}
- Status狀態
@@ -3627,11 +3577,6 @@ and the corresponding package Ids for installed tools using the command
具有未記錄變更的列代表變更來自 .NET CLI 工作負載命令以外的動作。這通常代表對 .NET SDK 或 Visual Studio 的更新。
-
- Unrecognized directive '{0}'.
- 無法識別的指示詞 '{0}'。
- {0} is the directive name like 'package' or 'sdk'.
- Update all tools.更新所有工具。
diff --git a/src/Cli/dotnet/dotnet.csproj b/src/Cli/dotnet/dotnet.csproj
index 2e63f9a3c5a8..d72287d41799 100644
--- a/src/Cli/dotnet/dotnet.csproj
+++ b/src/Cli/dotnet/dotnet.csproj
@@ -24,7 +24,6 @@
-
@@ -107,4 +106,5 @@
OverwriteReadOnlyFiles="true" />
+
diff --git a/src/Cli/dotnet/xlf/CliStrings.cs.xlf b/src/Cli/dotnet/xlf/CliStrings.cs.xlf
index a55342a500c5..4d98951538ee 100644
--- a/src/Cli/dotnet/xlf/CliStrings.cs.xlf
+++ b/src/Cli/dotnet/xlf/CliStrings.cs.xlf
@@ -187,16 +187,6 @@ Příklady:
CONFIGURATION
-
- Could not find any project in `{0}`.
- V {0} se nenašel žádný projekt.
-
-
-
- Could not find project or directory `{0}`.
- Nenašel se projekt ani adresář {0}.
-
- Specified solution file {0} does not exist, or there is no solution file in the directory.Zadaný soubor řešení {0} neexistuje nebo v adresáři není soubor řešení.
@@ -683,11 +673,6 @@ setx PATH "%PATH%;{0}"
Je k dispozici více než jedno zabalené překrytí: {0}.
-
- Found more than one project in `{0}`. Specify which one to use.
- V {0} se našlo několik projektů. Vyberte, který z nich chcete použít.
-
- Found more than one solution file in {0}. Specify which one to use.V {0} se našlo několik souborů řešení. Vyberte, který z nich chcete použít.
diff --git a/src/Cli/dotnet/xlf/CliStrings.de.xlf b/src/Cli/dotnet/xlf/CliStrings.de.xlf
index 92adccab4830..bc3f1b891170 100644
--- a/src/Cli/dotnet/xlf/CliStrings.de.xlf
+++ b/src/Cli/dotnet/xlf/CliStrings.de.xlf
@@ -187,16 +187,6 @@ Beispiele:
CONFIGURATION
-
- Could not find any project in `{0}`.
- In "{0}" wurde kein Projekt gefunden.
-
-
-
- Could not find project or directory `{0}`.
- Das Projekt oder Verzeichnis "{0}" wurde nicht gefunden.
-
- Specified solution file {0} does not exist, or there is no solution file in the directory.Die angegebene Projektmappendatei "{0}" ist nicht vorhanden, oder das Verzeichnis enthält keine Projektmappendatei.
@@ -683,11 +673,6 @@ setx PATH "%PATH%;{0}"
Mehr als ein paketierter Shim verfügbar: {0}.
-
- Found more than one project in `{0}`. Specify which one to use.
- In "{0}" wurden mehrere Projekte gefunden. Geben Sie an, welches davon verwendet werden soll.
-
- Found more than one solution file in {0}. Specify which one to use.In "{0}" wurden mehrere Projektmappendateien gefunden. Geben Sie an, welche davon verwendet werden soll.
diff --git a/src/Cli/dotnet/xlf/CliStrings.es.xlf b/src/Cli/dotnet/xlf/CliStrings.es.xlf
index db4dd74c1447..05f66cc2ab37 100644
--- a/src/Cli/dotnet/xlf/CliStrings.es.xlf
+++ b/src/Cli/dotnet/xlf/CliStrings.es.xlf
@@ -187,16 +187,6 @@ Ejemplos:
CONFIGURATION
-
- Could not find any project in `{0}`.
- No se encuentra ningún proyecto en "{0}".
-
-
-
- Could not find project or directory `{0}`.
- No se encuentra el proyecto o directorio "{0}".
-
- Specified solution file {0} does not exist, or there is no solution file in the directory.El archivo de solución {0} especificado no existe, o bien no hay ningún archivo de solución en el directorio.
@@ -683,11 +673,6 @@ setx PATH "%PATH%;{0}"
Hay más de una opción de correcciones de compatibilidad (shim) empaquetadas: {0}.
-
- Found more than one project in `{0}`. Specify which one to use.
- Se han encontrado varios proyectos en "{0}". Especifique el que debe usarse.
-
- Found more than one solution file in {0}. Specify which one to use.Se han encontrado varios archivos de solución en {0}. Especifique el que debe usarse.
diff --git a/src/Cli/dotnet/xlf/CliStrings.fr.xlf b/src/Cli/dotnet/xlf/CliStrings.fr.xlf
index f9b5582e4302..7968195a4351 100644
--- a/src/Cli/dotnet/xlf/CliStrings.fr.xlf
+++ b/src/Cli/dotnet/xlf/CliStrings.fr.xlf
@@ -187,16 +187,6 @@ Exemples :
CONFIGURATION
-
- Could not find any project in `{0}`.
- Projet introuvable dans '{0}'.
-
-
-
- Could not find project or directory `{0}`.
- Projet ou répertoire '{0}' introuvable.
-
- Specified solution file {0} does not exist, or there is no solution file in the directory.Le fichier solution spécifié {0} n'existe pas ou il n'y a pas de fichier solution dans le répertoire.
@@ -683,11 +673,6 @@ setx PATH "%PATH%;{0}"
Plusieurs shims empaquetés sont disponibles : {0}.
-
- Found more than one project in `{0}`. Specify which one to use.
- Plusieurs projets dans '{0}'. Spécifiez celui à utiliser.
-
- Found more than one solution file in {0}. Specify which one to use.Plusieurs fichiers solution dans {0}. Spécifiez celui à utiliser.
diff --git a/src/Cli/dotnet/xlf/CliStrings.it.xlf b/src/Cli/dotnet/xlf/CliStrings.it.xlf
index 8e5fb8a55e03..90ba455c7218 100644
--- a/src/Cli/dotnet/xlf/CliStrings.it.xlf
+++ b/src/Cli/dotnet/xlf/CliStrings.it.xlf
@@ -187,16 +187,6 @@ Esempi:
CONFIGURATION
-
- Could not find any project in `{0}`.
- Non è stato trovato alcun progetto in `{0}`.
-
-
-
- Could not find project or directory `{0}`.
- Non sono stati trovati progetti o directory `{0}`.
-
- Specified solution file {0} does not exist, or there is no solution file in the directory.Il file di soluzione specificato {0} non esiste oppure nella directory non è presente alcun file di soluzione.
@@ -683,11 +673,6 @@ setx PATH "%PATH%;{0}"
Sono disponibili più shim inclusi nel pacchetto: {0}.
-
- Found more than one project in `{0}`. Specify which one to use.
- Sono stati trovati più progetti in `{0}`. Specificare quello da usare.
-
- Found more than one solution file in {0}. Specify which one to use.Sono stati trovati più file di soluzione in {0}. Specificare quello da usare.
diff --git a/src/Cli/dotnet/xlf/CliStrings.ja.xlf b/src/Cli/dotnet/xlf/CliStrings.ja.xlf
index 2504e04d917d..47377273be7c 100644
--- a/src/Cli/dotnet/xlf/CliStrings.ja.xlf
+++ b/src/Cli/dotnet/xlf/CliStrings.ja.xlf
@@ -187,16 +187,6 @@ Examples:
CONFIGURATION
-
- Could not find any project in `{0}`.
- `{0}` にプロジェクトが見つかりませんでした。
-
-
-
- Could not find project or directory `{0}`.
- プロジェクトまたはディレクトリ `{0}` が見つかりませんでした。
-
- Specified solution file {0} does not exist, or there is no solution file in the directory.指定したソリューション ファイル {0} が存在しないか、ディレクトリにソリューション ファイルがありません。
@@ -683,11 +673,6 @@ setx PATH "%PATH%;{0}"
複数のパッケージ化された shim が利用可能です: {0}。
-
- Found more than one project in `{0}`. Specify which one to use.
- `{0}` に複数のプロジェクトが見つかりました。使用するプロジェクトを指定してください。
-
- Found more than one solution file in {0}. Specify which one to use.{0} に複数のソリューション ファイルが見つかりました。使用するファイルを指定してください。
diff --git a/src/Cli/dotnet/xlf/CliStrings.ko.xlf b/src/Cli/dotnet/xlf/CliStrings.ko.xlf
index af4f6dc21b68..732c93bac391 100644
--- a/src/Cli/dotnet/xlf/CliStrings.ko.xlf
+++ b/src/Cli/dotnet/xlf/CliStrings.ko.xlf
@@ -187,16 +187,6 @@ Examples:
CONFIGURATION
-
- Could not find any project in `{0}`.
- '{0}'에서 프로젝트를 찾을 수 없습니다.
-
-
-
- Could not find project or directory `{0}`.
- 프로젝트 또는 디렉터리 {0}을(를) 찾을 수 없습니다.
-
- Specified solution file {0} does not exist, or there is no solution file in the directory.지정한 솔루션 파일 {0}이(가) 없거나 디렉터리에 솔루션 파일이 없습니다.
@@ -683,11 +673,6 @@ setx PATH "%PATH%;{0}"
패키지된 shim을 하나 이상 사용할 수 있습니다. {0}
-
- Found more than one project in `{0}`. Specify which one to use.
- '{0}'에서 프로젝트를 두 개 이상 찾았습니다. 사용할 프로젝트를 지정하세요.
-
- Found more than one solution file in {0}. Specify which one to use.{0}에서 솔루션 파일을 두 개 이상 찾았습니다. 사용할 파일을 지정하세요.
diff --git a/src/Cli/dotnet/xlf/CliStrings.pl.xlf b/src/Cli/dotnet/xlf/CliStrings.pl.xlf
index b92f633f89d0..a2f053cef056 100644
--- a/src/Cli/dotnet/xlf/CliStrings.pl.xlf
+++ b/src/Cli/dotnet/xlf/CliStrings.pl.xlf
@@ -187,16 +187,6 @@ Przykłady:
CONFIGURATION
-
- Could not find any project in `{0}`.
- Nie można odnaleźć żadnego projektu w lokalizacji „{0}”.
-
-
-
- Could not find project or directory `{0}`.
- Nie można odnaleźć projektu ani katalogu „{0}”.
-
- Specified solution file {0} does not exist, or there is no solution file in the directory.Określony plik rozwiązania {0} nie istnieje bądź w katalogu nie ma żadnego pliku rozwiązania.
@@ -683,11 +673,6 @@ setx PATH "%PATH%;{0}"
Dostępna jest więcej niż jedna spakowana podkładka: {0}.
-
- Found more than one project in `{0}`. Specify which one to use.
- Znaleziono więcej niż jeden projekt w lokalizacji „{0}”. Określ, który ma zostać użyty.
-
- Found more than one solution file in {0}. Specify which one to use.Znaleziono więcej niż jeden plik rozwiązania w lokalizacji {0}. Określ, który ma zostać użyty.
diff --git a/src/Cli/dotnet/xlf/CliStrings.pt-BR.xlf b/src/Cli/dotnet/xlf/CliStrings.pt-BR.xlf
index 48cd96b70fad..02d0604176b2 100644
--- a/src/Cli/dotnet/xlf/CliStrings.pt-BR.xlf
+++ b/src/Cli/dotnet/xlf/CliStrings.pt-BR.xlf
@@ -187,16 +187,6 @@ Exemplos:
CONFIGURATION
-
- Could not find any project in `{0}`.
- Não foi possível encontrar nenhum projeto em ‘{0}’.
-
-
-
- Could not find project or directory `{0}`.
- Não foi possível encontrar o projeto ou diretório ‘{0}’.
-
- Specified solution file {0} does not exist, or there is no solution file in the directory.O arquivo de solução {0} especificado não existe ou não há um arquivo de solução no diretório.
@@ -683,11 +673,6 @@ setx PATH "%PATH%;{0}"
Há mais de um shim empacotado disponível: {0}.
-
- Found more than one project in `{0}`. Specify which one to use.
- Foi encontrado mais de um projeto em ‘{0}’. Especifique qual deve ser usado.
-
- Found more than one solution file in {0}. Specify which one to use.Foi encontrado mais de um arquivo de solução em {0}. Especifique qual deve ser usado.
diff --git a/src/Cli/dotnet/xlf/CliStrings.ru.xlf b/src/Cli/dotnet/xlf/CliStrings.ru.xlf
index 774a83ee7bd9..735d73a6e3da 100644
--- a/src/Cli/dotnet/xlf/CliStrings.ru.xlf
+++ b/src/Cli/dotnet/xlf/CliStrings.ru.xlf
@@ -187,16 +187,6 @@ Examples:
CONFIGURATION
-
- Could not find any project in `{0}`.
- Не удалось найти проекты в "{0}".
-
-
-
- Could not find project or directory `{0}`.
- Не удалось найти проект или каталог "{0}".
-
- Specified solution file {0} does not exist, or there is no solution file in the directory.Указанный файл решения "{0}" не существует, или в каталоге нет файла решения.
@@ -683,11 +673,6 @@ setx PATH "%PATH%;{0}"
Доступно несколько упакованных оболочек совместимости: {0}.
-
- Found more than one project in `{0}`. Specify which one to use.
- Найдено несколько проектов в "{0}". Выберите один.
-
- Found more than one solution file in {0}. Specify which one to use.Найдено несколько файлов решений в {0}. Выберите один.
diff --git a/src/Cli/dotnet/xlf/CliStrings.tr.xlf b/src/Cli/dotnet/xlf/CliStrings.tr.xlf
index e3a3c95596ea..b589fa58d34b 100644
--- a/src/Cli/dotnet/xlf/CliStrings.tr.xlf
+++ b/src/Cli/dotnet/xlf/CliStrings.tr.xlf
@@ -187,16 +187,6 @@ Bu bağımsız değişken, birden çok değişken sağlamak için birden çok ke
CONFIGURATION
-
- Could not find any project in `{0}`.
- `{0}` içinde proje bulunamadı.
-
-
-
- Could not find project or directory `{0}`.
- `{0}` projesi veya dizini bulunamadı.
-
- Specified solution file {0} does not exist, or there is no solution file in the directory.Belirtilen {0} çözüm dosyası yok veya dizinde bir çözüm dosyası yok.
@@ -683,11 +673,6 @@ setx PATH "%PATH%;{0}"
Birden fazla paketlenmiş dolgu var: {0}.
-
- Found more than one project in `{0}`. Specify which one to use.
- `{0}` içinde birden fazla proje bulundu. Hangisinin kullanılacağını belirtin.
-
- Found more than one solution file in {0}. Specify which one to use.{0} içinde birden fazla çözüm dosyası bulundu. Hangisinin kullanılacağını belirtin.
diff --git a/src/Cli/dotnet/xlf/CliStrings.zh-Hans.xlf b/src/Cli/dotnet/xlf/CliStrings.zh-Hans.xlf
index 12a34a5c5fae..817c9bc27cd3 100644
--- a/src/Cli/dotnet/xlf/CliStrings.zh-Hans.xlf
+++ b/src/Cli/dotnet/xlf/CliStrings.zh-Hans.xlf
@@ -187,16 +187,6 @@ Examples:
CONFIGURATION
-
- Could not find any project in `{0}`.
- “{0}”中找不到任何项目。
-
-
-
- Could not find project or directory `{0}`.
- 找不到项目或目录“{0}”。
-
- Specified solution file {0} does not exist, or there is no solution file in the directory.指定的解决方案文件 {0} 不存在,或目录中没有解决方案文件。
@@ -683,11 +673,6 @@ setx PATH "%PATH%;{0}"
多个包装填充码可用: {0}。
-
- Found more than one project in `{0}`. Specify which one to use.
- 在“{0}”中找到多个项目。请指定使用哪一个。
-
- Found more than one solution file in {0}. Specify which one to use.在 {0} 中找到多个解决方案文件。请指定使用哪一个。
diff --git a/src/Cli/dotnet/xlf/CliStrings.zh-Hant.xlf b/src/Cli/dotnet/xlf/CliStrings.zh-Hant.xlf
index 7666715348c8..894648d19b32 100644
--- a/src/Cli/dotnet/xlf/CliStrings.zh-Hant.xlf
+++ b/src/Cli/dotnet/xlf/CliStrings.zh-Hant.xlf
@@ -187,16 +187,6 @@ Examples:
CONFIGURATION
-
- Could not find any project in `{0}`.
- 在 `{0}` 中找不到任何專案。
-
-
-
- Could not find project or directory `{0}`.
- 找不到專案或目錄 `{0}`。
-
- Specified solution file {0} does not exist, or there is no solution file in the directory.指定的方案檔 {0} 不存在,或目錄中沒有方案檔。
@@ -683,11 +673,6 @@ setx PATH "%PATH%;{0}"
有多個經過封裝的填充碼可用: {0}。
-
- Found more than one project in `{0}`. Specify which one to use.
- 在 `{0}` 中找到多個專案。請指定要使用的專案。
-
- Found more than one solution file in {0}. Specify which one to use.在 {0} 中找到多個解決方案檔。請指定要使用的檔案。
diff --git a/test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs b/test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs
index 72a600549d62..5a382eda3ecd 100644
--- a/test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs
+++ b/test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs
@@ -9,6 +9,7 @@
using Microsoft.DotNet.Cli.Commands.Run;
using Microsoft.DotNet.Cli.Run.Tests;
using Microsoft.DotNet.Cli.Utils;
+using Microsoft.DotNet.FileBasedPrograms;
namespace Microsoft.DotNet.Cli.Project.Convert.Tests;
@@ -715,7 +716,7 @@ public void ProcessingFails()
.WithWorkingDirectory(testInstance.Path)
.Execute()
.Should().Fail()
- .And.HaveStdErrContaining(RunFileTests.DirectiveError(filePath, 1, CliCommandStrings.UnrecognizedDirective, "invalid"));
+ .And.HaveStdErrContaining(RunFileTests.DirectiveError(filePath, 1, FileBasedProgramsResources.UnrecognizedDirective, "invalid"));
new DirectoryInfo(Path.Join(testInstance.Path))
.EnumerateDirectories().Should().BeEmpty();
@@ -1128,7 +1129,7 @@ public void Directives_Unknown(string directive)
#:sdk Test
#:{directive} Test
""",
- expectedWildcardPattern: RunFileTests.DirectiveError("/app/Program.cs", 2, CliCommandStrings.UnrecognizedDirective, directive));
+ expectedWildcardPattern: RunFileTests.DirectiveError("/app/Program.cs", 2, FileBasedProgramsResources.UnrecognizedDirective, directive));
}
[Fact]
@@ -1139,7 +1140,7 @@ public void Directives_Empty()
#:
#:sdk Test
""",
- expectedWildcardPattern: RunFileTests.DirectiveError("/app/Program.cs", 1, CliCommandStrings.UnrecognizedDirective, ""));
+ expectedWildcardPattern: RunFileTests.DirectiveError("/app/Program.cs", 1, FileBasedProgramsResources.UnrecognizedDirective, ""));
}
[Theory, CombinatorialData]
@@ -1151,7 +1152,7 @@ public void Directives_EmptyName(
inputCSharp: $"""
#:{directive}{value}
""",
- expectedWildcardPattern: RunFileTests.DirectiveError("/app/Program.cs", 1, CliCommandStrings.MissingDirectiveName, directive));
+ expectedWildcardPattern: RunFileTests.DirectiveError("/app/Program.cs", 1, FileBasedProgramsResources.MissingDirectiveName, directive));
}
[Theory]
@@ -1195,7 +1196,7 @@ public void Directives_EmptyValue(string value)
inputCSharp: $"""
#:project{value}
""",
- expectedWildcardPattern: RunFileTests.DirectiveError("/app/Program.cs", 1, CliCommandStrings.MissingDirectiveName, "project"));
+ expectedWildcardPattern: RunFileTests.DirectiveError("/app/Program.cs", 1, FileBasedProgramsResources.MissingDirectiveName, "project"));
}
[Fact]
@@ -1205,7 +1206,7 @@ public void Directives_MissingPropertyValue()
inputCSharp: """
#:property Test
""",
- expectedWildcardPattern: RunFileTests.DirectiveError("/app/Program.cs", 1, CliCommandStrings.PropertyDirectiveMissingParts));
+ expectedWildcardPattern: RunFileTests.DirectiveError("/app/Program.cs", 1, FileBasedProgramsResources.PropertyDirectiveMissingParts));
}
[Fact]
@@ -1215,7 +1216,7 @@ public void Directives_InvalidPropertyName()
inputCSharp: """
#:property 123Name=Value
""",
- expectedWildcardPattern: RunFileTests.DirectiveError("/app/Program.cs", 1, CliCommandStrings.PropertyDirectiveInvalidName, """
+ expectedWildcardPattern: RunFileTests.DirectiveError("/app/Program.cs", 1, FileBasedProgramsResources.PropertyDirectiveInvalidName, """
Name cannot begin with the '1' character, hexadecimal value 0x31.
"""));
}
@@ -1234,7 +1235,7 @@ public void Directives_InvalidName(string directiveKind, string expectedSeparato
{
VerifyConversionThrows(
inputCSharp: $"#:{directiveKind} Abc{actualSeparator}Xyz",
- expectedWildcardPattern: RunFileTests.DirectiveError("/app/Program.cs", 1, CliCommandStrings.InvalidDirectiveName, directiveKind, expectedSeparator));
+ expectedWildcardPattern: RunFileTests.DirectiveError("/app/Program.cs", 1, FileBasedProgramsResources.InvalidDirectiveName, directiveKind, expectedSeparator));
}
[Fact]
@@ -1277,11 +1278,11 @@ public void Directives_Escaping()
""",
expectedErrors:
[
- (1, CliCommandStrings.QuoteInDirective),
- (2, CliCommandStrings.QuoteInDirective),
- (3, CliCommandStrings.QuoteInDirective),
- (4, string.Format(CliCommandStrings.PropertyDirectiveInvalidName, "The ''' character, hexadecimal value 0x27, cannot be included in a name.")),
- (5, CliCommandStrings.QuoteInDirective),
+ (1, FileBasedProgramsResources.QuoteInDirective),
+ (2, FileBasedProgramsResources.QuoteInDirective),
+ (3, FileBasedProgramsResources.QuoteInDirective),
+ (4, string.Format(FileBasedProgramsResources.PropertyDirectiveInvalidName, "The ''' character, hexadecimal value 0x27, cannot be included in a name.")),
+ (5, FileBasedProgramsResources.QuoteInDirective),
]);
}
@@ -1321,7 +1322,7 @@ public void Directives_Whitespace()
""",
expectedErrors:
[
- (3, CliCommandStrings.QuoteInDirective),
+ (3, FileBasedProgramsResources.QuoteInDirective),
]);
}
@@ -1389,7 +1390,7 @@ public void Directives_AfterToken()
VerifyConversionThrows(
inputCSharp: source,
- expectedWildcardPattern: RunFileTests.DirectiveError("/app/Program.cs", 5, CliCommandStrings.CannotConvertDirective));
+ expectedWildcardPattern: RunFileTests.DirectiveError("/app/Program.cs", 5, FileBasedProgramsResources.CannotConvertDirective));
VerifyConversion(
inputCSharp: source,
@@ -1436,7 +1437,7 @@ public void Directives_AfterIf()
VerifyConversionThrows(
inputCSharp: source,
- expectedWildcardPattern: RunFileTests.DirectiveError("/app/Program.cs", 5, CliCommandStrings.CannotConvertDirective));
+ expectedWildcardPattern: RunFileTests.DirectiveError("/app/Program.cs", 5, FileBasedProgramsResources.CannotConvertDirective));
VerifyConversion(
inputCSharp: source,
@@ -1525,7 +1526,7 @@ public void Directives_Duplicate()
""",
expectedErrors:
[
- (2, string.Format(CliCommandStrings.DuplicateDirective, "#:property Prop")),
+ (2, string.Format(FileBasedProgramsResources.DuplicateDirective, "#:property Prop")),
]);
VerifyDirectiveConversionErrors(
@@ -1537,8 +1538,8 @@ public void Directives_Duplicate()
""",
expectedErrors:
[
- (2, string.Format(CliCommandStrings.DuplicateDirective, "#:sdk Name")),
- (3, string.Format(CliCommandStrings.DuplicateDirective, "#:sdk Name")),
+ (2, string.Format(FileBasedProgramsResources.DuplicateDirective, "#:sdk Name")),
+ (3, string.Format(FileBasedProgramsResources.DuplicateDirective, "#:sdk Name")),
]);
VerifyDirectiveConversionErrors(
@@ -1550,8 +1551,8 @@ public void Directives_Duplicate()
""",
expectedErrors:
[
- (2, string.Format(CliCommandStrings.DuplicateDirective, "#:package Name")),
- (3, string.Format(CliCommandStrings.DuplicateDirective, "#:package Name")),
+ (2, string.Format(FileBasedProgramsResources.DuplicateDirective, "#:package Name")),
+ (3, string.Format(FileBasedProgramsResources.DuplicateDirective, "#:package Name")),
]);
VerifyDirectiveConversionErrors(
@@ -1570,8 +1571,8 @@ public void Directives_Duplicate()
""",
expectedErrors:
[
- (2, string.Format(CliCommandStrings.DuplicateDirective, "#:property Prop")),
- (4, string.Format(CliCommandStrings.DuplicateDirective, "#:property Prop")),
+ (2, string.Format(FileBasedProgramsResources.DuplicateDirective, "#:property Prop")),
+ (4, string.Format(FileBasedProgramsResources.DuplicateDirective, "#:property Prop")),
]);
VerifyDirectiveConversionErrors(
@@ -1581,7 +1582,7 @@ public void Directives_Duplicate()
""",
expectedErrors:
[
- (2, string.Format(CliCommandStrings.DuplicateDirective, "#:property prop")),
+ (2, string.Format(FileBasedProgramsResources.DuplicateDirective, "#:property prop")),
]);
}
@@ -1621,7 +1622,7 @@ private static void Convert(string inputCSharp, out string actualProject, out st
var sourceFile = new SourceFile(filePath ?? programPath, SourceText.From(inputCSharp, Encoding.UTF8));
actualDiagnostics = null;
var diagnosticBag = collectDiagnostics ? DiagnosticBag.Collect(out actualDiagnostics) : DiagnosticBag.ThrowOnFirst();
- var directives = VirtualProjectBuildingCommand.FindDirectives(sourceFile, reportAllErrors: !force, diagnosticBag);
+ var directives = FileLevelDirectiveHelpers.FindDirectives(sourceFile, reportAllErrors: !force, diagnosticBag);
var projectWriter = new StringWriter();
VirtualProjectBuildingCommand.WriteProjectFile(projectWriter, directives, isVirtualProject: false);
actualProject = projectWriter.ToString();
@@ -1650,7 +1651,7 @@ private static void VerifyConversionThrows(string inputCSharp, string expectedWi
private static void VerifyDirectiveConversionErrors(string inputCSharp, IEnumerable<(int LineNumber, string Message)> expectedErrors)
{
var sourceFile = new SourceFile(programPath, SourceText.From(inputCSharp, Encoding.UTF8));
- VirtualProjectBuildingCommand.FindDirectives(sourceFile, reportAllErrors: true, DiagnosticBag.Collect(out var diagnostics));
+ FileLevelDirectiveHelpers.FindDirectives(sourceFile, reportAllErrors: true, DiagnosticBag.Collect(out var diagnostics));
VerifyErrors(diagnostics, expectedErrors);
}
diff --git a/test/dotnet.Tests/CommandTests/Run/FileBasedAppSourceEditorTests.cs b/test/dotnet.Tests/CommandTests/Run/FileBasedAppSourceEditorTests.cs
index 371b29d7f314..f6b181615b72 100644
--- a/test/dotnet.Tests/CommandTests/Run/FileBasedAppSourceEditorTests.cs
+++ b/test/dotnet.Tests/CommandTests/Run/FileBasedAppSourceEditorTests.cs
@@ -3,6 +3,7 @@
using Microsoft.CodeAnalysis.Text;
using Microsoft.DotNet.Cli.Commands.Run;
+using Microsoft.DotNet.FileBasedPrograms;
namespace Microsoft.DotNet.Cli.Run.Tests;
diff --git a/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs b/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs
index db3696b077ec..8ddcb05c7301 100644
--- a/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs
+++ b/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs
@@ -10,6 +10,7 @@
using Microsoft.DotNet.Cli.Commands;
using Microsoft.DotNet.Cli.Commands.Run;
using Microsoft.DotNet.Cli.Utils;
+using Microsoft.DotNet.FileBasedPrograms;
namespace Microsoft.DotNet.Cli.Run.Tests;
@@ -135,7 +136,7 @@ private static string PrepareOutOfTreeBaseDirectory()
internal static string DirectiveError(string path, int line, string messageFormat, params ReadOnlySpan