Subject: | |
From: | |
Reply To: | |
Date: | Fri, 30 Mar 2007 08:48:46 -0600 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
OT: I had the following error in a C# process for a BizTalk custom
pipeline.
Event Type: Information
Event Source: 45Write Strm
Event Category: None
Event ID: 0
Date: 3/29/2007
Time: 10:28:24 PM
User: N/A
Computer: PHSQL
Description:
System.NullReferenceException: Object reference not set to an instance
of an object.
at EncodeComponentES.EncodeComponentES.Execute(IPipelineContext
pContext, IBaseMessage pInMsg)
Here is the Try catch it failed in:
try
{
int exitCode = p.ExitCode;
if (exitCode == 0)
{
FileStream file = null;
file = new FileStream(HoldFile,
System.IO.FileMode.Open);
byte[] tmpBuff = new byte[4096];
int bytesRead = 0;
while ((bytesRead = file.Read(tmpBuff, 0,
tmpBuff.Length)) != 0)
{
strm.Write(tmpBuff, 0, bytesRead);
}
strm.Position = 0;
file.Close();
file = null;
EventLog.WriteEntry("22Custom len",
file.Length.ToString());
EventLog.WriteEntry("24Custom len2",
tmpBuff.ToString());
p.Close();
}
}
catch (Exception e)
{
EventLog.WriteEntry("45Write Strm",
e.ToString());
}
Here is the definition of strm
Stream strm = new MemoryStream();
Anyone see the error?
Thanks
Kent
Primary Health
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|