Right, so i have this code:
Byte[] bin = p.GetAsByteArray();
File.WriteAllBytes(@"C:\Report.xlsx", bin);
Now p
is an ExcelPackage
object, which is a class to manipulate xlsx files.
though p
has data the following command just doesn't create the file and no errors occur.
I Believe it has something to do with the fact that i'm running this on windows 7, however i'm only debugging via VS.
I'm using .Net 4.5, Anyone knows what can be the issue?
File.WriteAllBytes
is silently failing. Is it even getting to that line? What has your debugging shown you? If it's a problem with the IO, then the source of the data is irrelevant, and you should be able to see the same thing in a short but complete console app which just writes a few random bytes to the same file. – Jon SkeetWriteAllBytes
and line after i see nothing in between. – eric.itzhakWriteAllBytes
did silently fail for me while trying to write to my current directory, which was not C:\ – Dan Loughney