Closed jaydeboer closed 5 months ago
I've found that if you change the project type to <Project Sdk="Microsoft.NET.Sdk.Worker">
you can get around the issue.
Seems like they fixed this in 8.0.200, so that all project types can now use /t:PublishContainer https://github.com/dotnet/sdk-container-builds/issues/141
I'll get it changed - cheers :)
This has just gone out in v8.0.4 (nuget in ten mins or so)
One thing you will have to do though for Sdk (console) apps. You have to opt in to container support as per the docs here: https://learn.microsoft.com/en-us/dotnet/core/docker/publish-as-container?pivots=dotnet-8-0
You don't need to add the containers nuget package as its backed into the sdk, but you have to add
<PropertyGroup>
<IsPublishable>true</IsPublishable>
<EnableSdkContainerSupport>true</EnableSdkContainerSupport>
</PropertyGroup>
🔥 Bug Description
Our application is a mixture of projects of
<Project Sdk="Microsoft.NET.Sdk.Web">
and<Project Sdk="Microsoft.NET.Sdk">
types. AllMicrosoft.NET.Sdk
project types displayA publish profile with the name 'DefaultContainer' was not found in the project. Set the PublishProfile property to a valid file name.
and do not push a container to the repository duringaspirate build
🔍 Steps to Reproduce the Bug
<Project Sdk="Microsoft.NET.Sdk">
project referenced in yourAppHost
project.aspirate build
aspirate apply
and no container will be running because it isn't in the repository.🧯 Possible Solution
dotnet/sdk-container-builds
there are two different commands, one for web project and a different one for non-web projects. I am guessing this is where the issue is coming from.