+1 vote

I am currently receiving errors from "new MsgConverter()" after upgrading my system to .net472 for TLS12 compliance.

My code runs as:

var converter = new MsgConverter(Stream file);

On my last release branch I am having no issue with .msg files, but on my current branch I am receiving error:
"Unsupported Compound File version."

When I run:

var test = new MsgConverter(@"C:\SampleMSGFile.msg");

I get error:

System.UnauthorizedAccessException:
'Access to path C:\SampleMSGFile.msg ' is denied

I have put my sample msg in different folders (including project folder) and have given ever user full access on it in security tab, but still the same error. I have also verified my sampleMSG works in prod and on the last release branch.

I have also installed half a dozen different versions of the nuget package with the same error.

Do you guys have any experience that may lend a hand here?

Thanks for any help!

Grant

by
reshown by

1 Answer

0 votes
 
Best answer

Most likely the file you are trying to parse is broken.

'Unsupported Compound File version' error means the file has a correct magic value, but later on, file is corrupted. I suggest trying a different file as the first step in trying to identify what the problem is.

UnauthorizedAccessException is definitely an access problem, not related to Mail.dll.

by (301k points)
...