XAML MSBuild task XamlMarkupCompilePass1 fails in parallel MSBuild and throws error Access denied

被刻印的时光 ゝ 提交于 2020-01-31 12:09:57

问题


We have several projects containing XAML UI and XAML workflow files. Since we enabled execution of MSBuild in parallel, with the flag /m the builds, from time to time we get an exception in the MSBuild task XamlMarkupCompilePass1

##[error]C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Xaml.targets(193,5): Error XC1000: XC1020: Build error occurred in the XAML MSBuild task: 'Could not load file or assembly 'file:///C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Facades\System.Threading.ThreadPool.dll' or one of its dependencies. Access is denied.

This is just an example, it is also happening sometimes on NuGet packages and not only .NET framework assemblies.

What is our setup: We have build servers and on each we have at least 2 build agents.

What did we try out already:

  1. Turning off build agents to have only one per server, still running MSBuild with /m --> failed with Access denied
  2. Run msbuild without /m --> was successful, but not a solution because of too long running build
  3. Try to use a hidden flag for MSBuild, to retry on access denied MSBUILDALWAYSRETRY --> this is only used for Copy MSBuild task and not the XAML msbuild task

Question: Is there a way to affect the MSBuild task XamlMarkupCompilePass1 somehow? or is there another solution than turning off parallel execution of MSBuild? I guess there is also a possibility that XamlMarkupCompilePass2 could fail as well but didn't see that.

来源:https://stackoverflow.com/questions/59838231/xaml-msbuild-task-xamlmarkupcompilepass1-fails-in-parallel-msbuild-and-throws-er

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!