When loading a very large schemas that is referenced multiple times in application.schemas an OutOfMemoryException can popup. I suggest to change
BizTalkApplication.cs, move line 262 (s.load()) to within the if statement just below. Add it just before this.schema.add(s) statement.
So only loaded when added to hash.
Schema.cs, replace the two 'this.xmlContent=' lines at line 170 with a function ChangeUtf16ToUtf8(schema) call.
private void ChangeUtf16ToUtf8(BzTalk.ExplorerOM.Schema schema)
{
// replace of stringbuilder is much more efficient than a string.replace
StringBuilder sTmp = new StringBuilder(schema.XmlContent).Replace("utf-16", "utf-8").Replace("UTF-16", "UTF-8");
this.xmlContent = sTmp.ToString();
sTmp.Clear(); // if necessary, when leaving function this becomes out-of-scope and is for th GC I think
}
When loading a very large schemas that is referenced multiple times in application.schemas an OutOfMemoryException can popup. I suggest to change
private void ChangeUtf16ToUtf8(BzTalk.ExplorerOM.Schema schema) { // replace of stringbuilder is much more efficient than a string.replace StringBuilder sTmp = new StringBuilder(schema.XmlContent).Replace("utf-16", "utf-8").Replace("UTF-16", "UTF-8"); this.xmlContent = sTmp.ToString(); sTmp.Clear(); // if necessary, when leaving function this becomes out-of-scope and is for th GC I think }