generated from dotnet/new-repo
-
Notifications
You must be signed in to change notification settings - Fork 46
Closed
Labels
Description
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