From d9e8947ff4c20c9878cc6ea46661e73cc245b536 Mon Sep 17 00:00:00 2001 From: Peter Huene Date: Mon, 9 Jul 2018 11:47:59 -0700 Subject: [PATCH] Revert implementation of the --mode option for the publish command. This commit reverts the implementation of the `--mode` option for the `dotnet publish` command. A bug in the apphost prevents this feature from working properly in some cases and there currently is not a mechanism to service it with this feature. The team has decided to move this feature to 2.2.1xx for the .NET Core SDK. Fixes dotnet/sdk#2380. --- build/DependencyVersions.props | 2 +- .../dotnet-publish/LocalizableStrings.resx | 23 ++---- src/dotnet/commands/dotnet-publish/Program.cs | 31 -------- .../dotnet-publish/PublishCommandParser.cs | 14 +--- .../xlf/LocalizableStrings.cs.xlf | 44 +++-------- .../xlf/LocalizableStrings.de.xlf | 44 +++-------- .../xlf/LocalizableStrings.es.xlf | 44 +++-------- .../xlf/LocalizableStrings.fr.xlf | 44 +++-------- .../xlf/LocalizableStrings.it.xlf | 44 +++-------- .../xlf/LocalizableStrings.ja.xlf | 44 +++-------- .../xlf/LocalizableStrings.ko.xlf | 44 +++-------- .../xlf/LocalizableStrings.pl.xlf | 44 +++-------- .../xlf/LocalizableStrings.pt-BR.xlf | 44 +++-------- .../xlf/LocalizableStrings.ru.xlf | 44 +++-------- .../xlf/LocalizableStrings.tr.xlf | 44 +++-------- .../xlf/LocalizableStrings.zh-Hans.xlf | 44 +++-------- .../xlf/LocalizableStrings.zh-Hant.xlf | 44 +++-------- .../Commands/PublishCommand.cs | 10 +-- .../GivenDotnetPublishPublishesProjects.cs | 78 ++++--------------- 19 files changed, 156 insertions(+), 574 deletions(-) diff --git a/build/DependencyVersions.props b/build/DependencyVersions.props index d4227b341..4da59168b 100644 --- a/build/DependencyVersions.props +++ b/build/DependencyVersions.props @@ -23,7 +23,7 @@ $(MicrosoftCodeAnalysisCSharpPackageVersion) $(MicrosoftCodeAnalysisCSharpPackageVersion) $(MicrosoftCodeAnalysisCSharpPackageVersion) - 2.1.400-preview-63027-01 + 2.1.400-preview-63109-04 $(MicrosoftNETSdkPackageVersion) $(MicrosoftAspNetCoreAppPackageVersion) 2.1.400-preview1-20180614-1774926 diff --git a/src/dotnet/commands/dotnet-publish/LocalizableStrings.resx b/src/dotnet/commands/dotnet-publish/LocalizableStrings.resx index 59c01c3af..1537472b5 100644 --- a/src/dotnet/commands/dotnet-publish/LocalizableStrings.resx +++ b/src/dotnet/commands/dotnet-publish/LocalizableStrings.resx @@ -135,16 +135,9 @@ The path to a target manifest file that contains the list of packages to be excluded from the publish step. - - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - - - MODE + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. +The default is 'true' if a runtime identifier is specified. Do not build the project before publishing. Implies --no-restore. @@ -153,16 +146,10 @@ The default is 'self-contained' when a target runtime is specified. The target framework to publish for. The target framework has to be specified in the project file. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. The configuration to publish for. The default for most projects is 'Debug'. - - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - - - The specified publish mode '{0}' is not supported. - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/Program.cs b/src/dotnet/commands/dotnet-publish/Program.cs index 631416b82..ed8f3260c 100644 --- a/src/dotnet/commands/dotnet-publish/Program.cs +++ b/src/dotnet/commands/dotnet-publish/Program.cs @@ -39,37 +39,6 @@ namespace Microsoft.DotNet.Tools.Publish var appliedPublishOption = result["dotnet"]["publish"]; - if (appliedPublishOption.HasOption("mode") && appliedPublishOption.HasOption("self-contained")) - { - throw new GracefulException(LocalizableStrings.PublishModeAndSelfContainedOptionsConflict); - } - - var mode = appliedPublishOption.ValueOrDefault("mode"); - switch (mode) - { - case null: - break; - - case PublishCommandParser.SelfContainedMode: - msbuildArgs.Add("-p:SelfContained=true"); - break; - - case PublishCommandParser.FxDependentMode: - msbuildArgs.Add("-p:SelfContained=false"); - break; - - case PublishCommandParser.FxDependentNoExeMode: - msbuildArgs.Add("-p:SelfContained=false"); - msbuildArgs.Add("-p:UseAppHost=false"); - break; - - default: - throw new GracefulException( - string.Format( - LocalizableStrings.UnsupportedPublishMode, - mode)); - } - msbuildArgs.AddRange(appliedPublishOption.OptionValuesToBeForwarded()); msbuildArgs.AddRange(appliedPublishOption.Arguments); diff --git a/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs b/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs index 96519680f..19ee3ec12 100644 --- a/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs +++ b/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs @@ -10,10 +10,6 @@ namespace Microsoft.DotNet.Cli { internal static class PublishCommandParser { - public const string SelfContainedMode = "self-contained"; - public const string FxDependentMode = "fx-dependent"; - public const string FxDependentNoExeMode = "fx-dependent-no-exe"; - public static Command Publish() => CreateWithRestoreOptions.Command( "publish", @@ -44,7 +40,7 @@ namespace Microsoft.DotNet.Cli Accept.NoArguments().ForwardAs("-property:NoBuild=true")), Create.Option( "--self-contained", - "", // Hidden option for backwards-compatibility (now '--mode self-contained'). + LocalizableStrings.SelfContainedOptionDescription, Accept.ZeroOrOneArgument() .WithSuggestionsFrom("true", "false") .ForwardAsSingle(o => @@ -52,14 +48,6 @@ namespace Microsoft.DotNet.Cli string value = o.Arguments.Any() ? o.Arguments.Single() : "true"; return $"-property:SelfContained={value}"; })), - Create.Option( - "--mode", - LocalizableStrings.ModeOptionDescription, - Accept.AnyOneOf( - SelfContainedMode, - FxDependentMode, - FxDependentNoExeMode) - .With(name: LocalizableStrings.ModeOptionName)), CommonOptions.NoRestoreOption(), CommonOptions.VerbosityOption()); } diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf index 65cdf77c0..99f4af0de 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf @@ -37,16 +37,22 @@ Cesta k cílovému souboru manifestu obsahujícímu seznam balíčků, které se mají vyloučit z kroku publikování + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. +The default is 'true' if a runtime identifier is specified. + Publikuje spolu s aplikací modul runtime .NET Core, aby se tento modul nemusel instalovat na cílový počítač. Standardně se nastaví na True, pokud je zadaný identifikátor modulu runtime. + + Do not build the project before publishing. Implies --no-restore. Nesestavujte projekt, dokud ho nepublikujete. Implikuje možnost --no-restore. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. @@ -54,36 +60,6 @@ The default is to publish a framework-dependent application without an executabl The configuration to publish for. The default for most projects is 'Debug'. - - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - - - - MODE - MODE - - - - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - - - - The specified publish mode '{0}' is not supported. - The specified publish mode '{0}' is not supported. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf index 54fe79e46..7a670d1f5 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf @@ -37,16 +37,22 @@ Der Pfad zu einer Zielmanifestdatei, die die Liste der von der Veröffentlichung auszuschließenden Pakete enthält. + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. +The default is 'true' if a runtime identifier is specified. + Veröffentlichen Sie die .NET Core-Runtime mit Ihrer Anwendung, damit die Runtime auf dem Zielcomputer nicht installiert werden muss. Der Standardwert ist "true", wenn ein Runtimebezeichner angegeben ist. + + Do not build the project before publishing. Implies --no-restore. Erstellt das Projekt nicht vor dem Veröffentlichen. Impliziert "--no-restore". - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. @@ -54,36 +60,6 @@ The default is to publish a framework-dependent application without an executabl The configuration to publish for. The default for most projects is 'Debug'. - - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - - - - MODE - MODE - - - - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - - - - The specified publish mode '{0}' is not supported. - The specified publish mode '{0}' is not supported. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf index d71ab145b..e3cd6f556 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf @@ -37,16 +37,22 @@ La ruta de acceso a un archivo de manifiesto de destino que contiene la lista de paquetes que se excluirán del paso de publicación. + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. +The default is 'true' if a runtime identifier is specified. + Publica el tiempo de ejecución de .NET Core con su aplicación para que no sea necesario instalarlo en la máquina de destino. Si se especifica un identificador de tiempo de ejecución, se toma como predeterminado el valor "true". + + Do not build the project before publishing. Implies --no-restore. No compile el proyecto antes de publicarlo. Implica --no-restore. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. @@ -54,36 +60,6 @@ The default is to publish a framework-dependent application without an executabl The configuration to publish for. The default for most projects is 'Debug'. - - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - - - - MODE - MODE - - - - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - - - - The specified publish mode '{0}' is not supported. - The specified publish mode '{0}' is not supported. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf index dbc2c0835..13935a23a 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf @@ -37,16 +37,22 @@ Chemin d'un fichier manifeste cible contenant la liste des packages à exclure de l'étape de publication. + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. +The default is 'true' if a runtime identifier is specified. + Publiez le runtime .NET Core avec votre application pour éviter à l'utilisateur de l'installer sur la machine cible. La valeur par défaut est 'true' si un identificateur de runtime est spécifié. + + Do not build the project before publishing. Implies --no-restore. Ne pas générer le projet avant la publication. Implique --no-restore. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. @@ -54,36 +60,6 @@ The default is to publish a framework-dependent application without an executabl The configuration to publish for. The default for most projects is 'Debug'. - - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - - - - MODE - MODE - - - - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - - - - The specified publish mode '{0}' is not supported. - The specified publish mode '{0}' is not supported. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf index d6b3ca3ca..85b719aa1 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf @@ -37,16 +37,22 @@ Percorso di un file manifesto di destinazione che contiene l'elenco di pacchetti da escludere dal passaggio di pubblicazione. + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. +The default is 'true' if a runtime identifier is specified. + Pubblica il runtime di .NET Core con l'applicazione in modo che non sia necessario installarlo nel computer di destinazione. Se si specifica un identificatore di runtime, l'impostazione predefinita è 'true'. + + Do not build the project before publishing. Implies --no-restore. Non compila il progetto prima della pubblicazione. Implica --no-restore. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. @@ -54,36 +60,6 @@ The default is to publish a framework-dependent application without an executabl The configuration to publish for. The default for most projects is 'Debug'. - - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - - - - MODE - MODE - - - - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - - - - The specified publish mode '{0}' is not supported. - The specified publish mode '{0}' is not supported. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf index 36949f48d..e67184cae 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf @@ -37,16 +37,22 @@ 発行ステップから除外されるパッケージのリストを含むターゲット マニフェスト ファイルへのパス。 + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. +The default is 'true' if a runtime identifier is specified. + ランタイムをターゲット マシンにインストールしなくてもよいよう、.NET Core ランタイムをアプリケーションと一緒に発行します。ランタイム ID が指定される場合、既定の 'true' になります。 + + Do not build the project before publishing. Implies --no-restore. 発行する前にプロジェクトをビルドしないでください。--no-restore を意味します。 - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. @@ -54,36 +60,6 @@ The default is to publish a framework-dependent application without an executabl The configuration to publish for. The default for most projects is 'Debug'. - - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - - - - MODE - MODE - - - - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - - - - The specified publish mode '{0}' is not supported. - The specified publish mode '{0}' is not supported. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf index b5781e2e6..79dc21315 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf @@ -37,16 +37,22 @@ 게시 단계에서 제외할 패키지 목록이 들어 있는 대상 매니페스트 파일의 경로입니다. + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. +The default is 'true' if a runtime identifier is specified. + 런타임은 대상 컴퓨터에 설치할 필요가 없으므로 응용 프로그램과 함께 .NET Core 런타임을 게시합니다. 런타임 식별자가 지정된 경우 기본값은 'true'입니다. + + Do not build the project before publishing. Implies --no-restore. 게시하기 전에 프로젝트를 빌드하지 않습니다. 복원 없음을 의미합니다. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. @@ -54,36 +60,6 @@ The default is to publish a framework-dependent application without an executabl The configuration to publish for. The default for most projects is 'Debug'. - - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - - - - MODE - MODE - - - - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - - - - The specified publish mode '{0}' is not supported. - The specified publish mode '{0}' is not supported. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf index cb4c0c981..e0494fbd9 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf @@ -37,16 +37,22 @@ Ścieżka do docelowego pliku manifestu zawierającego listę pakietów, które mają zostać wykluczone z kroku publikowania. + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. +The default is 'true' if a runtime identifier is specified. + Opublikuj środowisko uruchomieniowe programu .NET Core z aplikacją, aby nie trzeba było go instalować na maszynie docelowej. Domyślnie jest ustawiona wartość „true” w przypadku określenia identyfikatora środowiska uruchomieniowego. + + Do not build the project before publishing. Implies --no-restore. Nie kompiluj tego projektu przed opublikowaniem. Powoduje przyjęcie, że podano parametr --no-restore. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. @@ -54,36 +60,6 @@ The default is to publish a framework-dependent application without an executabl The configuration to publish for. The default for most projects is 'Debug'. - - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - - - - MODE - MODE - - - - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - - - - The specified publish mode '{0}' is not supported. - The specified publish mode '{0}' is not supported. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf index f7c91c76c..e635876eb 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf @@ -37,16 +37,22 @@ O caminho para um arquivo de manifesto de destino que contém a lista de pacotes a serem excluídos da etapa de publicação. + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. +The default is 'true' if a runtime identifier is specified. + Publique o tempo de execução .NET Core com seu aplicativo para que o tempo de execução não precise ser instalado no computador de destino. Assumirá 'true' como padrão se um identificador de tempo de execução for especificado. + + Do not build the project before publishing. Implies --no-restore. Não compile o projeto antes de publicar. Implica em --no-restore. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. @@ -54,36 +60,6 @@ The default is to publish a framework-dependent application without an executabl The configuration to publish for. The default for most projects is 'Debug'. - - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - - - - MODE - MODE - - - - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - - - - The specified publish mode '{0}' is not supported. - The specified publish mode '{0}' is not supported. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf index 2b269e4ec..97c45336c 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf @@ -37,16 +37,22 @@ Путь к целевому файлу манифеста, содержащему список пакетов, исключаемых из публикации. + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. +The default is 'true' if a runtime identifier is specified. + Опубликуйте среду выполнения .NET Core вместе с приложением, чтобы ее не нужно было устанавливать на целевом компьютере. Если идентификатор среды выполнения указан, значение по умолчанию — true. + + Do not build the project before publishing. Implies --no-restore. Сборка проекта перед публикацией не выполняется. Подразумевает --no-restore. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. @@ -54,36 +60,6 @@ The default is to publish a framework-dependent application without an executabl The configuration to publish for. The default for most projects is 'Debug'. - - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - - - - MODE - MODE - - - - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - - - - The specified publish mode '{0}' is not supported. - The specified publish mode '{0}' is not supported. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf index d39339db9..ec7335186 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf @@ -37,16 +37,22 @@ Yayımlama adımının dışında tutulacak paketlerin listesini içeren bir hedef bildirim dosyasının yolu. + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. +The default is 'true' if a runtime identifier is specified. + Çalışma zamanının hedef makineye yüklenmesine gerek kalmaması için, .NET Core çalışma zamanını uygulamanızla birlikte yayımlayın. Bir çalışma zamanı tanımlayıcısı belirtilmişse, varsayılan olarak 'true' değerine ayarlanır. + + Do not build the project before publishing. Implies --no-restore. Yayımlamadan önce projeyi derlemeyin. --no-restore anlamına gelir. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. @@ -54,36 +60,6 @@ The default is to publish a framework-dependent application without an executabl The configuration to publish for. The default for most projects is 'Debug'. - - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - - - - MODE - MODE - - - - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - - - - The specified publish mode '{0}' is not supported. - The specified publish mode '{0}' is not supported. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf index 277fcd58e..bd47a935c 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf @@ -37,16 +37,22 @@ 指向目标清单文件的路径,该文件包含要通过发布步骤执行的包的列表。 + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. +The default is 'true' if a runtime identifier is specified. + 随附应用程序发布 .NET Core 运行时,免除在目标计算机上安装运行时的需求。如果指定了运行时标识符,则默认为 “true”。 + + Do not build the project before publishing. Implies --no-restore. 发布之前不要生成项目。Implies --no-restore. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. @@ -54,36 +60,6 @@ The default is to publish a framework-dependent application without an executabl The configuration to publish for. The default for most projects is 'Debug'. - - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - - - - MODE - MODE - - - - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - - - - The specified publish mode '{0}' is not supported. - The specified publish mode '{0}' is not supported. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf index a23a56120..9a5770b10 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf @@ -37,16 +37,22 @@ 目標資訊清單檔案的路徑,其包含要從發行步驟中排除的套件清單。 + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. +The default is 'true' if a runtime identifier is specified. + 隨著應用程式一併發行 .NET Core 執行階段,因此不需要在目標電腦上安裝此執行階段。若指定了執行階段識別碼,則預設為 'true'。 + + Do not build the project before publishing. Implies --no-restore. 請勿在執行之前建置專案。提示:-no-restore。 - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. - The target runtime to publish the application for. -The default is to publish a framework-dependent application without an executable. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. + The target runtime to publish for. This is used when creating a self-contained deployment. +The default is to publish a framework-dependent application. @@ -54,36 +60,6 @@ The default is to publish a framework-dependent application without an executabl The configuration to publish for. The default for most projects is 'Debug'. - - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - The mode to use when publishing the application. -The 'self-contained' mode publishes the application with the .NET Core runtime. -The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. -The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. -The default is 'fx-dependent-no-exe' when a target runtime is not specified. -The default is 'self-contained' when a target runtime is specified. - - - - MODE - MODE - - - - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. - - - - The specified publish mode '{0}' is not supported. - The specified publish mode '{0}' is not supported. - - \ No newline at end of file diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/PublishCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/PublishCommand.cs index a22b5acf7..ada6a80be 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/PublishCommand.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/PublishCommand.cs @@ -13,7 +13,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities private string _output; private string _runtime; private List _targetManifests = new List(); - private string _mode; + private bool? _selfContained; public PublishCommand WithFramework(string framework) { @@ -44,9 +44,9 @@ namespace Microsoft.DotNet.Tools.Test.Utilities return this; } - public PublishCommand WithMode(string value) + public PublishCommand WithSelfContained(bool value) { - _mode = value; + _selfContained = value; return this; } @@ -69,7 +69,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities OutputOption, TargetOption, RuntimeOption, - ModeOption); + SelfContainedOption); } private string FrameworkOption => string.IsNullOrEmpty(_framework) ? "" : $"-f {_framework}"; @@ -80,6 +80,6 @@ namespace Microsoft.DotNet.Tools.Test.Utilities private string TargetOption => string.Join(" ", _targetManifests); - private string ModeOption => string.IsNullOrEmpty(_mode) ? "" : $"--mode {_mode}"; + private string SelfContainedOption => _selfContained.HasValue ? $"--self-contained:{_selfContained.Value}" : ""; } } diff --git a/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs b/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs index 01e4b5922..d78108d3e 100644 --- a/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs +++ b/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs @@ -97,15 +97,14 @@ namespace Microsoft.DotNet.Cli.Publish.Tests } [Theory] - [InlineData("self-contained", null)] - [InlineData(null, null)] - [InlineData(null, "--self-contained")] - [InlineData(null, "--self-contained=true")] - public void ItPublishesSelfContainedWithRid(string mode, string args) + [InlineData(null)] + [InlineData("--self-contained")] + [InlineData("--self-contained=true")] + public void ItPublishesSelfContainedWithRid(string args) { var testAppName = "MSBuildTestApp"; var rid = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier(); - var outputDirectory = PublishApp(testAppName, rid, mode, args); + var outputDirectory = PublishApp(testAppName, rid, args); var outputProgram = Path.Combine(outputDirectory.FullName, $"{testAppName}{Constants.ExeSuffix}"); @@ -116,16 +115,14 @@ namespace Microsoft.DotNet.Cli.Publish.Tests } [Theory] - [InlineData("fx-dependent", null)] - [InlineData(null, "--self-contained=false")] - public void ItPublishesFrameworkDependentWithRid(string mode, string args) + [InlineData("--self-contained=false")] + public void ItPublishesFrameworkDependentWithRid(string args) { var testAppName = "MSBuildTestApp"; var rid = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier(); - var outputDirectory = PublishApp(testAppName, rid, mode, args); + var outputDirectory = PublishApp(testAppName, rid, args); outputDirectory.Should().OnlyHaveFiles(new[] { - $"{testAppName}{Constants.ExeSuffix}", $"{testAppName}.dll", $"{testAppName}.pdb", $"{testAppName}.deps.json", @@ -134,31 +131,6 @@ namespace Microsoft.DotNet.Cli.Publish.Tests var outputProgram = Path.Combine(outputDirectory.FullName, $"{testAppName}{Constants.ExeSuffix}"); - var command = new TestCommand(outputProgram); - command.Environment[Environment.Is64BitProcess ? "DOTNET_ROOT" : "DOTNET_ROOT(x86)"] = - new RepoDirectoriesProvider().DotnetRoot; - - command.ExecuteWithCapturedOutput() - .Should() - .Pass() - .And - .HaveStdOutContaining("Hello World"); - } - - [Fact] - public void ItPublishesFrameworkDependentNoExeWithRid() - { - var testAppName = "MSBuildTestApp"; - var rid = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier(); - var outputDirectory = PublishApp(testAppName, rid, mode: "fx-dependent-no-exe"); - - outputDirectory.Should().OnlyHaveFiles(new[] { - $"{testAppName}.dll", - $"{testAppName}.pdb", - $"{testAppName}.deps.json", - $"{testAppName}.runtimeconfig.json", - }); - new DotnetCommand() .ExecuteWithCapturedOutput(Path.Combine(outputDirectory.FullName, $"{testAppName}.dll")) .Should().Pass() @@ -166,14 +138,12 @@ namespace Microsoft.DotNet.Cli.Publish.Tests } [Theory] - [InlineData("fx-dependent-no-exe", null)] - [InlineData("fx-dependent", null)] - [InlineData(null, "--self-contained=false")] - [InlineData(null, null)] - public void ItPublishesFrameworkDependentWithoutRid(string mode, string args) + [InlineData("--self-contained=false")] + [InlineData(null)] + public void ItPublishesFrameworkDependentWithoutRid(string args) { var testAppName = "MSBuildTestApp"; - var outputDirectory = PublishApp(testAppName, rid: null, mode: mode, args: args); + var outputDirectory = PublishApp(testAppName, rid: null, args: args); outputDirectory.Should().OnlyHaveFiles(new[] { $"{testAppName}.dll", @@ -188,10 +158,10 @@ namespace Microsoft.DotNet.Cli.Publish.Tests .And.HaveStdOutContaining("Hello World"); } - private DirectoryInfo PublishApp(string testAppName, string rid, string mode, string args = null) + private DirectoryInfo PublishApp(string testAppName, string rid, string args = null) { var testInstance = TestAssets.Get(testAppName) - .CreateInstance($"PublishApp_{rid ?? "none"}_{mode ?? "none"}_{args ?? "none"}") + .CreateInstance($"PublishApp_{rid ?? "none"}_{args ?? "none"}") .WithSourceFiles() .WithRestoreFiles(); @@ -199,7 +169,6 @@ namespace Microsoft.DotNet.Cli.Publish.Tests new PublishCommand() .WithRuntime(rid) - .WithMode(mode) .WithWorkingDirectory(testProjectDirectory) .Execute(args ?? "") .Should().Pass(); @@ -336,24 +305,5 @@ namespace Microsoft.DotNet.Cli.Publish.Tests .Should() .Fail(); } - - [Fact] - public void ItFailsToPublishIfBothModeAndSelfContainedAreSpecified() - { - var testInstance = TestAssets.Get("MSBuildTestApp") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var testProjectDirectory = testInstance.Root; - - new PublishCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute("--self-contained --mode fx-dependent") - .Should() - .Fail() - .And - .HaveStdErrContaining(LocalizableStrings.PublishModeAndSelfContainedOptionsConflict); - } } }