Visual studio "build solution" error MSB3073 Code 6

Visual Studio “build solution” successfully only if unreal editor is closed

What might be the problem?

resolved by using ctrl + alt + f11 to build instead of “build solution” options