Before applying rotation, your application might need to detect the current monitor configuration:
using System.Runtime.InteropServices;