Locked dll error in Visual Studio

I’m using Visual Studio 2022 and Unreal Engine 5.4.4 built from source. When I run the editor from VS right after I’ve closed a previous launch the build fails and I get the following error (same error line repeats for a bunch on engine DLLs):

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "C:\UE\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Build\bin\Development\net6.0\EpicGames.Build.dll" to "..\..\..\Binaries\DotNET\UnrealBuildTool\EpicGames.Build.dll". Beginning retry 10 in 1000ms. The process cannot access the file '..\..\..\Binaries\DotNET\UnrealBuildTool\EpicGames.Build.dll' because it is being used by another process. The file is locked by: ".NET Host (19484), .NET Host (52864)"

This is quite inconvenient as almost every second run fails and makes development very slow. I guess MSBuild from the previous run is locking DLLs but I’m not sure what’s the permanent solution for this.

Has anyone experienced something similar? Any fixes?
Thanks

Greetings @keianhzo

This is from a third party and not part of anything Epic directly recommended. But, I saw users having this same error and found some solutions. See if this can help .net - Visual Studio 2012 warning MSB3026: Could not copy DLL files - Stack Overflow

Thanks for answering.

I was in the VS community forums before and tried those things but none of them are permanent. It must be something related to VS indeed as I’ve switched to VSCode and it works like a charm. I’m surprised that this is not a much more common issue for other people using VS…