Added conditional code to select console or service under Mono