.net – Unable to build Windows Workflow project in windows docker. Error – XamlBuildTask.dll not found


This is my docker file –

FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019
RUN net user admin /ADD
RUN net localgroup Administrators /add admin
USER admin

RUN C:\TEMP\vs_buildtools.exe modify`
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" ^ `
--add Microsoft.VisualStudio.Component.Workflow.BuildTools ^ `
--quiet --norestart --nocache --wait `

SHELL ["cmd", "/C"]

CMD [ "cmd" ]

I want to install the Workflow.BuildTools component but this does not work. The build succeeds and I still get a failure when building workflow projects.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Xaml.targets(193,5): error MSB4062: The "Microsoft.Build.Tasks.Xaml.PartialClassGenerationTask" task could not be loade 
d from the assembly C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\amd64\XamlBuildTask.dll. Could not load file or assembly 'file:///C:\Progr 
am Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\amd64\XamlBuildTask.dll' or one of its dependencies. 

What can I do to fix this?

Leave a Reply

Your email address will not be published. Required fields are marked *