Open DaveBubenik opened 5 months ago
I have been facing the same issue for the last 3 days,. I started seeing this issue after upgrading from .net 6.0 to .net 8
I am also seeing this error in Azure DevOps and not when building locally. Azure DevOps uses an agent Windows Server 2019
I was able reproduce this with a minimal example:
I've attached a project using the above sequence. The Azure build pipeline file is azure-pipelines.yml. BlazorApp.zip
Can anyone give any insight on what "path2" is?
@DaveBubenik , @mynpmpackage , We are investigating this and will update when we have more info.
@dbreshears Thanks!
Just wanted to let you know I also opened a bug with runner-images: https://github.com/actions/runner-images/issues/10031
Not sure who is responsible for a fix
@DaveBubenik we suspect we know what caused the regression but are struggling to get a local repo to validate the fix.
In the meantime, we were able to work around the issue in our repro build by explicitly using the x64 version of msbuild. To do this add msbuildArchitecture: 'x64'
to your VSBuild task in the build definition.
Hitting the same problem. Confirmed broken in VS 17.10.1 Confirmed working in VS 17.9.x It's actually 'Clean' that fails on docker-compose project. It only fails when running MSBuild in console (works ok in VS GUI)
@NCarlsonMSFT I tried your workaround, but now the project is complaining that I'm trying to build Linux containers on a host configured for Windows containers.
I realize trying to build in this configuration may seem odd, but we're attempting to run Unit Tests and Vulnerability scans on the original project. So we use a Windows agent to perform this task. Looking at older build pipelines outputs I can see that the project was being built, but I'm not sure if the actual container images are being created.
We don't actually use the container images from the docker compose for the build pipeline job. So I was able to keep things running by creating a project configuration that doesn't build the compose project.
But it would be nice to not have a separate configuration for my build pipelines.
@robal can you try the workaround for specifying msbuildArchitecture: 'x64'
on the VSBuild task?
@DaveBubenik I must admit that configuring the default windows build agent to build linux containers is outside my area of expertise. Doing some quick research the general recommendation appears to be to create a custom build agent configured to meet your needs. Personally, I would create a VM Scale set agent with a base image that has the VS Build SKU installed and Docker Desktop (Depending on your licensing, you may need to use Docker CE in WSL #417). The major downside to this approach is that you will be responsible for updating your base image.
@NCarlsonMSFT msbuildArchitecture: 'x64'
workaround doesn't seem to work in my case
@robal What error are you getting when using the x64 msbuild? Is this failing locally from the command line or only on the build server?
@mynpmpackage are you intending to build linux containers as well? What error are you getting? It could be that you were accidentally building windows containers when targeting .NET 6. There was a change in .NET 8 that the windows images now require a specific tag (details: https://learn.microsoft.com/en-us/dotnet/core/compatibility/containers/8.0/multi-platform-tags)
The workaround helped me
The workaround helped me as well. We used the following instruction to set up our build.
Hi, any news regarding the issue @DaveBubenik reported?
This has been affecting us as well. I am sure this is a wider implication than people are reporting as we see more and more people upgrading to latest versions. Any updates are greatly appreciated. For now the only solution seems to be removing the docker-compose from our debug build to move on. And the only reason we are able to move on is that we only use the docker-compose for local dev environment.
Just an update to anyone reading this thread, I also opened a bug in the runner-images repo: https://github.com/actions/runner-images/issues/10031
They basically said that I needed to convert all of my docker images to use Windows containers. This isn't possible for my project because we rely on a few Linux packages for our containers.
My guess is that things used to work because the VSBuild task used to skip building the images in the docker-compose project. Someone noticed this and "fixed" it.
If you are still searching for a solution and you don't care about the containers that are generated when using VSBuild, this is what you need to do:
Something to note when following the above steps, it's not necessary to use the msbuildArchitecture: 'x64'
fix that is recommended in the other comments because the solution is being updated to omit the project from the build.
Here is an updated version of my sample project that makes things work again: BlazorApp.zip
We've opened a work item on our backlog to add an MSBuildProperty for disabling image build to make a more maintainable work-around.
In the 17.12 previews we've added an msbuild property for dcproj DockerComposeBuildEnabled
. If you set that to false
the dcproj will not build.
I'm seeing this error when building in Azure DevOps on Microsoft Hosted Agents. I don't see the error when I build locally on Visual Studio Pro Version 17.10.1.
Azure DevOps uses an agent with the following configuration: https://github.com/actions/runner-images/blob/win22/20240603.1/images/windows/Windows2022-Readme.md
Here is the full error: