Skip to content

New -a and --os are self-contained by default #19706

@richlander

Description

@richlander

Was testing these new switches per #18889. They are self-contained by default. That's not what I was expecting.

From the spec:

That means that the following commands would be equivalent:

  • dotnet build -a x64 --os win
  • dotnet build -r win-x64 --no-self-contained

This is what I see:

PS C:\Users\rich\app> dotnet --version
6.0.100-rc.1.21411.12
PS C:\Users\rich\app> ls

    Directory: C:\Users\rich\app

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---           8/12/2021  1:22 PM            171 app.csproj
-a---           7/30/2021  4:16 PM            185 Program.cs

PS C:\Users\rich\app> cat .\app.csproj
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
  </PropertyGroup>

</Project>
PS C:\Users\rich\app> dotnet build -a x64
Microsoft (R) Build Engine version 17.0.0-preview-21411-04+6ca861613 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored C:\Users\rich\app\app.csproj (in 2.74 sec).
  You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
  app -> C:\Users\rich\app\bin\Debug\net6.0\win-x64\app.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:05.41
PS C:\Users\rich\app> dir .\bin\Debug\net6.0\win-x64\System*.dll

    Directory: C:\Users\rich\app\bin\Debug\net6.0\win-x64

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---           8/11/2021  2:28 AM           5120 System.AppContext.dll
-a---           8/11/2021  2:28 AM           5120 System.Buffers.dll
-a---           8/11/2021  2:40 AM         236032 System.Collections.Concurrent.dll
-a---           8/11/2021  2:40 AM         254464 System.Collections.dll
-a---           8/11/2021  2:40 AM         655360 System.Collections.Immutable.dll
-a---           8/11/2021  2:40 AM          90624 System.Collections.NonGeneric.dll
...

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions