In your uproject file is the EngineAssociation updated to the newer version?
it should read:
"EngineAssociation": "5.4",
Also do you get any more information from the output window in vs?
Oh and if the engine is running (not sure when the error is thrown) then check if you have live coding enabled. It interferes with vs’s compile