Skip to content

IsPublishable property is not respected #464

@august-feng

Description

@august-feng

Hello!

I've got a solution Foo that encompasses two projects, Bar and Baz, where Baz does not have the Microsoft.NET.Build.Containers package installed and is configured with <IsPublishable>false</IsPublishable>.

dotnet publish --os linux --arch x64 /t:PublishContainer -c Release will still try to attempt to build Baz as a container image.

dotnet publish --os linux --arch x64 /t:PublishContainer -c Release
MSBuild version 17.5.0+6f08c67f3 for .NET
  Determining projects to restore...
  Restored /Users/august.feng/learn/fsharp.48/Baz/Baz.fsproj (in 51 ms).
  Restored /Users/august.feng/learn/fsharp.48/Bar/Bar.fsproj (in 79 ms).
  Bar -> /Users/august.feng/learn/fsharp.48/Bar/bin/Release/net7.0/linux-x64/Bar.dll
  Bar -> /Users/august.feng/learn/fsharp.48/Bar/bin/Release/net7.0/linux-x64/publish/
/Users/august.feng/learn/fsharp.48/Baz/Baz.fsproj : error MSB4057: The target "PublishContainer" does not exist in the project.
  Building image 'bar' with tags 1.0.0 on top of base image mcr.microsoft.com:443/dotnet/runtime:7.0
  Pushed container 'bar:1.0.0' to local daemon

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions