Error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing an assembly reference?

I want to use EditorUtility.DisplayDialog function. I added UnityEngine class in order to use this function. When the time to build comes I got this error. I checked reference list from solution explorer everything seems fine. No any syntax error. I missed the point but where?

– Solved –
Solved this particular problem by using this code block:

**# if UNITY_ENGINE
using UnityEditor;
# endif**