Fixed build events depending on solution-file directory.

Fixed always showing error 0 on dll loading error.