UE5(5.0.3) and visual studio2019 can't build

I create a blank C++ project, then build it in vs 2019, but it report the following errors:

Clean started...
1>------ Clean started: Project: P1, Configuration: Development_Editor x64 ------
1>Cleaning P1Editor and UnrealHeaderTool binaries...
1>UnrealBuildTool : error : Unable to delete E:\unreal\P1\Binaries\Win64\UnrealEditor-P1.dll (Unable to delete E:\unreal\P1\Binaries\Win64\UnrealEditor-P1.dll - 拒绝访问。
1>                        Processes with open handles to file:
1>                          16996: E:\Program Files\Epic Games\UE_5.0\Engine\Binaries\Win64\UnrealEditor.exe (started 2022/8/9 14:56:17))
1>c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(39,5): error MSB3073: The command ""E:\Program Files\Epic Games\UE_5.0\Engine\Build\BatchFiles\Clean.bat" P1Editor Win64 Development -Project="E:\unreal\P1\P1.uproject" -WaitMutex -FromMsBuild" exited with code -1.
1>Done building project "P1.vcxproj" -- FAILED.
2>------ Skipped Clean: Project: UE5, Configuration: BuiltWithUnrealBuildTool Win64 ------
2>Project not selected to build for this solution configuration 
========== Clean: 0 succeeded, 1 failed, 1 skipped ==========

what does this mean? why can’t delete dll files in Binaries directory?

Because they are open in Unreal Editor. Try to close it (And kill all hanging processes of it) and then build again.

1 Like

Thanks, it works.
In previous versions, I used to open UE editor and vs2019 at the same time, and then compile with vs。
I should read UE5 release notes again, learn how to build C++ project in UE5.

1 Like

with vs2019 and ue5 you can ctrl+alt+F11 from inside vs and have it build in ue5

1 Like