Click here to Skip to main content
15,921,941 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
MemoryStream stream = new MemoryStream();
XamlWriter.Save(doc, stream);

it is working properly but when loading huge sized doc then it is throwing outofmemoryexception.

Please tell me that how to increase the size of memorystream or any other way to avoid this error.

Thanks.
Posted
Updated 3-Jan-12 4:16am
v3
Comments
Wendelius 3-Jan-12 10:16am    
Pre tags added

This usually isn't caused by a limitation in the memorystream.

Do you have any large images in the XAML and/or are you using this[^]?
 
Share this answer
 
Because of the size, could you simply use a FileStream class instead of the MemoryStream? That may bring some extra overhead to your code but then again wouldn't use so excessively memory.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900