Added write-to-file support, please check if it's working in .net