public byte[] GetBinaryFileContents(string fileName)
{
fileName = this.PathResolver.GetFullPath(fileName);
var virtualPathProvider = HostingEnvironment.VirtualPathProvider;
var virtualFile = virtualPathProvider.GetFile(fileName);
using (var stream = virtualFile.Open())
{
var buffer = new byte[stream.Length];
stream.Read(buffer, 0, (int)stream.Length);
return buffer;
}
}