Help when building?

When I go on to publish my game it comes up with this:
UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x001b9] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:162
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:83
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
Also it said :
Error building Player because scripts had compiler errors.
Any ideas?
Btw it also had unity engine.dll could not be found.

Hello @TheChanger !

You are using Unity.Editor library

You can not build a game using Unity.Editor, I mean, All process of Unity.Editor only works on editor, not un Runtime. So… All scripts using Unity.Editor must be changed, to dont use that.

As this other Post says , Unity.Editor gives you tools for the editor, but there are no proicess avaiable for runtime.

I had the same issues once trying to build a project with NavmeshBuild (wich is from Unity Editor library).

you have to remake some scripts.