<div>Aspose.Email for .NET 4.0</div>
<div>Version 3.5.0.0</div>
<div>
<br>
</div>
When calling the following method on the Aspose.Email.Outlook.Pst.FolderInfo object:<div>
<br>
</div>
<div><b>AddMessage(MapiMessage message)</b></div>
<div>
<br>
</div>
<div>I occasionally receive the following error:</div>
<div>
<br>
</div>
<div><b>Unable to cast object of type '.' to type '.'</b></div>
<div>
<br>
</div>
<div>That is how it "pastes" here. When viewed in SublimeText2 it looks like this:</div>
<div>
<br>
<img src="http://www.mavyak.com/images/MailConverterException.JPG" alt="http://www.mavyak.com/images/MailConverterException.JPG"></div>
<div>
<br>
</div>
<div>This is the SafeFolder class referenced above:</div>
<div>
<br>
</div>
<div style="background-color: lightyellow;">
public class SafeFolder
{
SafePst parent;
FolderInfo unsafeFolder;
public SafeFolder(SafePst parent, FolderInfo unsafeFolder)
{
this.parent = parent;
this.unsafeFolder = unsafeFolder;
}
public void AddMessage(MapiMessage message)
{
lock (parent)
{
unsafeFolder.AddMessage(message);
}
}
}
<div>Is there enough information here to tell me what it's trying to cast to what (and maybe why it can't perform the cast)?</div>
<div>
<br>
</div>
<div>Please advise.</div>
<div>
<br>
</div>