Generating dll while UE4 editor is opened

I had a similar error and fixed it by:

  1. Making sure you have Automation Tool compiled.
  2. Copy AgentInterface.dll from Engine/Binaries/.DotNET to Engine/Binaries/Win64.
  3. Make sure you have UnrealLightMass.exe added to trusted applications on your Firewall.

Hope this helps somebody.