From f0c151c2c314123cfdcbc1c4aa7dd532d0492d31 Mon Sep 17 00:00:00 2001 From: Jan Jones Date: Wed, 13 Aug 2025 17:15:00 +0200 Subject: [PATCH 1/2] Disable static graph restore for file-based apps --- .../Run/VirtualProjectBuildingCommand.cs | 1 + .../CommandTests/Run/RunFileTests.cs | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs b/src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs index ec425f922a7c..3d6b7534321a 100644 --- a/src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs +++ b/src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs @@ -891,6 +891,7 @@ public static void WriteProjectFile( writer.WriteLine(""" false true + false """); } diff --git a/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs b/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs index ac068b1b909a..92b35fd5ddf1 100644 --- a/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs +++ b/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs @@ -1239,6 +1239,52 @@ public void NoRestore_02() .And.HaveStdOut("Hello from Program"); } + [Fact] + public void Restore_StaticGraph_Implicit() + { + var testInstance = _testAssetsManager.CreateTestDirectory(); + File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """ + + + true + + + """); + var programFile = Path.Join(testInstance.Path, "Program.cs"); + File.WriteAllText(programFile, "Console.WriteLine();"); + + // Remove artifacts from possible previous runs of this test. + var artifactsDir = VirtualProjectBuildingCommand.GetArtifactsPath(programFile); + if (Directory.Exists(artifactsDir)) Directory.Delete(artifactsDir, recursive: true); + + new DotnetCommand(Log, "restore", "Program.cs") + .WithWorkingDirectory(testInstance.Path) + .Execute() + .Should().Pass(); + } + + [Fact] + public void Restore_StaticGraph_Explicit() + { + var testInstance = _testAssetsManager.CreateTestDirectory(); + var programFile = Path.Join(testInstance.Path, "Program.cs"); + File.WriteAllText(programFile, """ + #:property RestoreUseStaticGraphEvaluation=true + Console.WriteLine(); + """); + + // Remove artifacts from possible previous runs of this test. + var artifactsDir = VirtualProjectBuildingCommand.GetArtifactsPath(programFile); + if (Directory.Exists(artifactsDir)) Directory.Delete(artifactsDir, recursive: true); + + new DotnetCommand(Log, "restore", "Program.cs") + .WithWorkingDirectory(testInstance.Path) + .Execute() + .Should().Fail() + // error MSB4025: The project file could not be loaded. Could not find file 'Program.csproj'. + .And.HaveStdOutContaining("MSB4025"); + } + [Fact] public void NoBuild_01() { @@ -2726,6 +2772,7 @@ public void Api() true false true + false net11.0 preview $(Features);FileBasedProgram @@ -2794,6 +2841,7 @@ public void Api_Diagnostic_01() true false true + false $(Features);FileBasedProgram @@ -2859,6 +2907,7 @@ public void Api_Diagnostic_02() true false true + false $(Features);FileBasedProgram From b6a604eb02c526d5cbac3048b279dd286d5171b5 Mon Sep 17 00:00:00 2001 From: Jan Jones Date: Fri, 15 Aug 2025 10:31:40 +0200 Subject: [PATCH 2/2] Improve error --- src/Cli/dotnet/Commands/CliCommandStrings.resx | 8 ++++++-- .../dotnet/Commands/Run/VirtualProjectBuildingCommand.cs | 8 +++++++- src/Cli/dotnet/Commands/xlf/CliCommandStrings.cs.xlf | 9 +++++++-- src/Cli/dotnet/Commands/xlf/CliCommandStrings.de.xlf | 9 +++++++-- src/Cli/dotnet/Commands/xlf/CliCommandStrings.es.xlf | 9 +++++++-- src/Cli/dotnet/Commands/xlf/CliCommandStrings.fr.xlf | 9 +++++++-- src/Cli/dotnet/Commands/xlf/CliCommandStrings.it.xlf | 9 +++++++-- src/Cli/dotnet/Commands/xlf/CliCommandStrings.ja.xlf | 9 +++++++-- src/Cli/dotnet/Commands/xlf/CliCommandStrings.ko.xlf | 9 +++++++-- src/Cli/dotnet/Commands/xlf/CliCommandStrings.pl.xlf | 9 +++++++-- src/Cli/dotnet/Commands/xlf/CliCommandStrings.pt-BR.xlf | 9 +++++++-- src/Cli/dotnet/Commands/xlf/CliCommandStrings.ru.xlf | 9 +++++++-- src/Cli/dotnet/Commands/xlf/CliCommandStrings.tr.xlf | 9 +++++++-- .../dotnet/Commands/xlf/CliCommandStrings.zh-Hans.xlf | 9 +++++++-- .../dotnet/Commands/xlf/CliCommandStrings.zh-Hant.xlf | 9 +++++++-- test/dotnet.Tests/CommandTests/Run/RunFileTests.cs | 3 +-- 16 files changed, 105 insertions(+), 31 deletions(-) diff --git a/src/Cli/dotnet/Commands/CliCommandStrings.resx b/src/Cli/dotnet/Commands/CliCommandStrings.resx index 3337a044fd80..20533336c3f3 100644 --- a/src/Cli/dotnet/Commands/CliCommandStrings.resx +++ b/src/Cli/dotnet/Commands/CliCommandStrings.resx @@ -1601,7 +1601,11 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue': {0} - {0} is the file path and line number. + {0} is the file path and line number.{Locked="#:property"} + + + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + {0} is the file path and line number.{Locked="#:property"} The directive at '{2}' should contain a name without special characters and an optional value separated by '{1}' like '#:{0} Name{1}Value'. @@ -2630,4 +2634,4 @@ Proceed? Specifying dlls or executables for 'dotnet test' should be via '--test-modules'. - \ No newline at end of file + diff --git a/src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs b/src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs index 3d6b7534321a..d150357a605c 100644 --- a/src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs +++ b/src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs @@ -1429,7 +1429,7 @@ public sealed class Property(in ParseInfo info) : Named(info) if (propertyValue is null) { - return context.Diagnostics.AddError(context.SourceFile, context.Info.Span, location => string.Format(CliCommandStrings.PropertyDirectiveMissingParts, location)); + return context.Diagnostics.AddError(context.SourceFile, context.Info.Span, static location => string.Format(CliCommandStrings.PropertyDirectiveMissingParts, location)); } try @@ -1441,6 +1441,12 @@ public sealed class Property(in ParseInfo info) : Named(info) return context.Diagnostics.AddError(context.SourceFile, context.Info.Span, location => string.Format(CliCommandStrings.PropertyDirectiveInvalidName, location, ex.Message), ex); } + if (propertyName.Equals("RestoreUseStaticGraphEvaluation", StringComparison.OrdinalIgnoreCase) && + MSBuildUtilities.ConvertStringToBool(propertyValue)) + { + context.Diagnostics.AddError(context.SourceFile, context.Info.Span, static location => string.Format(CliCommandStrings.StaticGraphRestoreNotSupported, location)); + } + return new Property(context.Info) { Name = propertyName, diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.cs.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.cs.xlf index ee6e5b6ad582..20dba5e8f0eb 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.cs.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.cs.xlf @@ -2433,8 +2433,8 @@ Nástroj {1} (verze {2}) se úspěšně nainstaloval. Do souboru manifestu {3} s The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue': {0} - Direktiva property musí mít dvě části oddělené znakem =, například #:property PropertyName=PropertyValue: {0} - {0} is the file path and line number. + Direktiva property musí mít dvě části oddělené znakem =, například #:property PropertyName=PropertyValue: {0} + {0} is the file path and line number.{Locked="#:property"} Publisher for the .NET Platform @@ -2972,6 +2972,11 @@ 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' at {0}. + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + {0} is the file path and line number.{Locked="#:property"} + Status Stav diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.de.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.de.xlf index 0a1ff542b6c9..df9e303574f6 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.de.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.de.xlf @@ -2433,8 +2433,8 @@ Das Tool "{1}" (Version {2}) wurde erfolgreich installiert. Der Eintrag wird der The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue': {0} - Die Eigenschaftsdirektive muss zwei durch "=" getrennte Teile aufweisen, z. B. "#:property PropertyName=PropertyValue": {0} - {0} is the file path and line number. + Die Eigenschaftsdirektive muss zwei durch "=" getrennte Teile aufweisen, z. B. "#:property PropertyName=PropertyValue": {0} + {0} is the file path and line number.{Locked="#:property"} Publisher for the .NET Platform @@ -2972,6 +2972,11 @@ 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' at {0}. + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + {0} is the file path and line number.{Locked="#:property"} + Status Status diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.es.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.es.xlf index cddf5a571320..6787e4fc57f3 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.es.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.es.xlf @@ -2433,8 +2433,8 @@ La herramienta "{1}" (versión "{2}") se instaló correctamente. Se ha agregado The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue': {0} - La directiva de propiedad debe tener dos partes separadas por "=", como "like '#:property PropertyName=PropertyValue": {0} - {0} is the file path and line number. + La directiva de propiedad debe tener dos partes separadas por "=", como "like '#:property PropertyName=PropertyValue": {0} + {0} is the file path and line number.{Locked="#:property"} Publisher for the .NET Platform @@ -2972,6 +2972,11 @@ 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' at {0}. + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + {0} is the file path and line number.{Locked="#:property"} + Status Estado diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.fr.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.fr.xlf index 968f09785cf8..9b87796e0e45 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.fr.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.fr.xlf @@ -2433,8 +2433,8 @@ L'outil '{1}' (version '{2}') a été correctement installé. L'entrée est ajou The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue': {0} - La directive de propriété doit avoir deux parties séparées par '=' comme '#:property PropertyName=PropertyValue' : {0} - {0} is the file path and line number. + La directive de propriété doit avoir deux parties séparées par '=' comme '#:property PropertyName=PropertyValue' : {0} + {0} is the file path and line number.{Locked="#:property"} Publisher for the .NET Platform @@ -2972,6 +2972,11 @@ 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' at {0}. + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + {0} is the file path and line number.{Locked="#:property"} + Status État diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.it.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.it.xlf index a0424aafc363..d7faaa357554 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.it.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.it.xlf @@ -2433,8 +2433,8 @@ Lo strumento '{1}' versione '{2}' è stato installato. La voce è stata aggiunta The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue': {0} - La direttiva di proprietà deve avere due parti separate da '=', come '#:property PropertyName=PropertyValue': {0} - {0} is the file path and line number. + La direttiva di proprietà deve avere due parti separate da '=', come '#:property PropertyName=PropertyValue': {0} + {0} is the file path and line number.{Locked="#:property"} Publisher for the .NET Platform @@ -2972,6 +2972,11 @@ 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' at {0}. + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + {0} is the file path and line number.{Locked="#:property"} + Status Stato diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ja.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ja.xlf index 6014e9132cd9..712337e2a091 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ja.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ja.xlf @@ -2433,8 +2433,8 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue': {0} - プロパティ ディレクティブには、'#:p droperty PropertyName=PropertyValue' のように '=' で区切られた 2 つの部分が必要です: {0} - {0} is the file path and line number. + プロパティ ディレクティブには、'#:p droperty PropertyName=PropertyValue' のように '=' で区切られた 2 つの部分が必要です: {0} + {0} is the file path and line number.{Locked="#:property"} Publisher for the .NET Platform @@ -2972,6 +2972,11 @@ Your project targets multiple frameworks. Specify which framework to run using ' 標準出力 + + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + {0} is the file path and line number.{Locked="#:property"} + Status 状態 diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ko.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ko.xlf index 41c26211d79f..a0c940f9627a 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ko.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ko.xlf @@ -2433,8 +2433,8 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue': {0} - property 지시문에는 '#:property PropertyName=PropertyValue'와 같이 '='로 구분된 두 부분이 있어야 합니다. {0}. - {0} is the file path and line number. + property 지시문에는 '#:property PropertyName=PropertyValue'와 같이 '='로 구분된 두 부분이 있어야 합니다. {0}. + {0} is the file path and line number.{Locked="#:property"} Publisher for the .NET Platform @@ -2972,6 +2972,11 @@ Your project targets multiple frameworks. Specify which framework to run using ' 표준 출력 + + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + {0} is the file path and line number.{Locked="#:property"} + Status 상태 diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pl.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pl.xlf index 260cf6754537..157ca3284a99 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pl.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pl.xlf @@ -2433,8 +2433,8 @@ Narzędzie „{1}” (wersja „{2}”) zostało pomyślnie zainstalowane. Wpis The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue': {0} - Dyrektywa właściwości musi mieć dwie części oddzielone znakiem „=”, na przykład „'#:property PropertyName=PropertyValue”: {0} - {0} is the file path and line number. + Dyrektywa właściwości musi mieć dwie części oddzielone znakiem „=”, na przykład „'#:property PropertyName=PropertyValue”: {0} + {0} is the file path and line number.{Locked="#:property"} Publisher for the .NET Platform @@ -2972,6 +2972,11 @@ 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' at {0}. + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + {0} is the file path and line number.{Locked="#:property"} + Status Stan diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pt-BR.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pt-BR.xlf index 7eabfeaceb4f..d943b3d37e63 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pt-BR.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.pt-BR.xlf @@ -2433,8 +2433,8 @@ A ferramenta '{1}' (versão '{2}') foi instalada com êxito. A entrada foi adici The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue': {0} - A diretiva de propriedade precisa ter duas partes separadas por "=", como "#:p roperty PropertyName=PropertyValue": {0} - {0} is the file path and line number. + A diretiva de propriedade precisa ter duas partes separadas por "=", como "#:p roperty PropertyName=PropertyValue": {0} + {0} is the file path and line number.{Locked="#:property"} Publisher for the .NET Platform @@ -2972,6 +2972,11 @@ 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' at {0}. + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + {0} is the file path and line number.{Locked="#:property"} + Status Status diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ru.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ru.xlf index 39bc18fcd5e5..85effdf4830f 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ru.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.ru.xlf @@ -2433,8 +2433,8 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue': {0} - Директива свойства должна иметь две части, разделенные символом "=", например "#:property PropertyName=PropertyValue": {0} - {0} is the file path and line number. + Директива свойства должна иметь две части, разделенные символом "=", например "#:property PropertyName=PropertyValue": {0} + {0} is the file path and line number.{Locked="#:property"} Publisher for the .NET Platform @@ -2972,6 +2972,11 @@ Your project targets multiple frameworks. Specify which framework to run using ' Стандартный вывод + + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + {0} is the file path and line number.{Locked="#:property"} + Status Состояние diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.tr.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.tr.xlf index 7a9399f4693a..b9499a82319f 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.tr.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.tr.xlf @@ -2433,8 +2433,8 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue': {0} - Özellik yönergesi '#:property PropertyName=PropertyValue' gibi '=' ile ayrılmış iki parçaya sahip olmalıdır: {0} - {0} is the file path and line number. + Özellik yönergesi '#:property PropertyName=PropertyValue' gibi '=' ile ayrılmış iki parçaya sahip olmalıdır: {0} + {0} is the file path and line number.{Locked="#:property"} Publisher for the .NET Platform @@ -2972,6 +2972,11 @@ Projeniz birden fazla Framework'ü hedefliyor. '{0}' kullanarak hangi Framework' Standart çıkış + + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + {0} is the file path and line number.{Locked="#:property"} + Status Durum diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hans.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hans.xlf index 1a0c54bbd52d..b2fc64c82895 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hans.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hans.xlf @@ -2433,8 +2433,8 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue': {0} - 属性指令需要包含两个由 ‘=’ 分隔的部件,例如 '#:property PropertyName=PropertyValue': {0} - {0} is the file path and line number. + 属性指令需要包含两个由 ‘=’ 分隔的部件,例如 '#:property PropertyName=PropertyValue': {0} + {0} is the file path and line number.{Locked="#:property"} Publisher for the .NET Platform @@ -2972,6 +2972,11 @@ Your project targets multiple frameworks. Specify which framework to run using ' 标准输出 + + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + {0} is the file path and line number.{Locked="#:property"} + Status 状态 diff --git a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hant.xlf b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hant.xlf index a2471aed589a..b7a15d661008 100644 --- a/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hant.xlf +++ b/src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hant.xlf @@ -2433,8 +2433,8 @@ Tool '{1}' (version '{2}') was successfully installed. Entry is added to the man The property directive needs to have two parts separated by '=' like '#:property PropertyName=PropertyValue': {0} - 屬性指示詞必須有兩個部分,其以 '=' 分隔,例如 '#:property PropertyName=PropertyValue': {0} - {0} is the file path and line number. + 屬性指示詞必須有兩個部分,其以 '=' 分隔,例如 '#:property PropertyName=PropertyValue': {0} + {0} is the file path and line number.{Locked="#:property"} Publisher for the .NET Platform @@ -2972,6 +2972,11 @@ Your project targets multiple frameworks. Specify which framework to run using ' 標準輸出 + + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + Static graph restore is not supported for file-based apps. Remove the '#:property' at {0}. + {0} is the file path and line number.{Locked="#:property"} + Status 狀態 diff --git a/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs b/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs index 92b35fd5ddf1..1f8a92fa4692 100644 --- a/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs +++ b/test/dotnet.Tests/CommandTests/Run/RunFileTests.cs @@ -1281,8 +1281,7 @@ public void Restore_StaticGraph_Explicit() .WithWorkingDirectory(testInstance.Path) .Execute() .Should().Fail() - // error MSB4025: The project file could not be loaded. Could not find file 'Program.csproj'. - .And.HaveStdOutContaining("MSB4025"); + .And.HaveStdErr(string.Format(CliCommandStrings.StaticGraphRestoreNotSupported, $"{programFile}:1")); } [Fact]