MikeB wrote:
Hello All,
I have a console application that is run via a scheduled task everyday at 4
in the morning. For some reason, a couple of days ago, every time the
scheduled task is run (ether manually or by scheduled time) I get a "The
surrogate pair is invalid" error. When ever I manually run the app by
double clicking it, it runs fine. Any ideas what could be causing this
error? It used to run fine previously and am pretty sure nothing changed on
the server.
Its a C# 2.0 application.
Are you using xml serialization? That error often comes up if there is
something invalid in the data that is being read/written to XML is
invalid or incorrect.
As to why you would only see this when running as a scheduled task
rather than when directly running the program, you need to look at
credentials. When you run the program manually it is running under the
context of the logged on user. What credentials does the scheduled task
run under (typically found in the properties for the scheduled task)?
My guess would be that the credentials that the task is running under do
not have access to some resource that the application assumes will
always be available.
If you can provide more details around where in the code the error is
being thrown and what the code is doing at that point, that would help
troubleshoot this problem further.
--
Tom Porterfield