-
-
Notifications
You must be signed in to change notification settings - Fork 764
Description
What You Are Seeing?
Setting the SelfContained property for DotNetCorePublishSettings does not emit the respective parameter when executed by DotNetCorePublish:
var settings = new DotNetCorePublishSettings
{
Framework = "netcoreapp2.0",
Runtime = "win-x64",
SelfContained = false,
Configuration = $"{configuration}",
OutputDirectory = artifactsRootDir + "/dist"
};
DotNetCorePublish("./src/" + appName + "/" + appName + ".csproj",settings);
What it produces at the command line:
Executing: "C:/Program Files/dotnet/dotnet.exe" publish "./src/ProjectName/ProjectName.csproj" --output "C:/projects/ProjectName/artifacts/debug/dist" --runtime win-x64 --framework netcoreapp2.0 --configuration debug
The --self-contained false parameter is missing. When --self-contained is omitted defaults to true when using --runtime.
https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish?tabs=netcore2x
This results in creating a self-contained publish.
What is Expected?
DotNetCorePublish to produce:
Executing: "C:/Program Files/dotnet/dotnet.exe" publish "./src/ProjectName/ProjectName.csproj" --output "C:/projects/ProjectName/artifacts/debug/dist" --runtime win-x64 --framework netcoreapp2.0 --configuration debug --self-contained false
What version of Cake are you using?
Version 0.26.1+Branch.main.Sha.b26790017b2befa7b35799eb9a0c1cba322b0c90
and
Version 0.27.1+Branch.main.Sha.7e44aa0319b6ef12ecc415d79a1c75cc98e2c788
Are you running on a 32 or 64 bit system?
x64
What environment are you running on? Windows? Linux? Mac?
Windows
Are you running on a CI Server? If so, which one?
Not yet.... just locally atm...
How Did You Get This To Happen? (Steps to Reproduce)
have a task to package .net core 2.0 command line app like below:
Task("Package")
.Description("packages app")
.Does(() =>
{
var settings = new DotNetCorePublishSettings
{
Framework = "netcoreapp2.0",
Runtime = "win-x64",
SelfContained = false,
Configuration = $"{configuration}",
OutputDirectory = artifactsRootDir + "/dist"
};
DotNetCorePublish("./src/" + appName + "/" + appName + ".csproj",settings);
});
Replace with the path to a sample .net core 2.0 command line application.
call via powershell .\build.ps1 -c debug -t package -verbosity diagnostic
Output Log
call via powershell .\build.ps1 -c debug -t package -verbosity diagnostic
Executing task: Package
Executing: "C:/Program Files/dotnet/dotnet.exe" publish "./src/ProjectName/ProjectName.csproj" --output "C:/projects/ProjectName/artifacts/debug/dist" --runtime win-x64 --framework netcoreapp2.0 --configuration debug
Microsoft (R) Build Engine version 15.6.84.34536 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 49.21 ms for C:\projects\ProjectName\src\ProjectName\ProjectName.csproj.
ProjectName -> C:\projects\ProjectName\src\ProjectName\bin\debug\netcoreapp2.0\win-x64\ProjectName.dll
ProjectName -> C:\projects\ProjectName\artifacts\debug\dist
Finished executing task: Package