Saturday, September 28, 2013

Error in Batch Job: Stack trace: Invalid attempt to call WinAPI.fileSize running in CIL on the client.

Batch Job end with error in Log as follows..

Stack trace: Invalid attempt to call WinAPI.fileSize running in CIL on the client.

The reason for this error is WINAPI in DocuActionArchive.add() method. Which will not work in batch job.

To solve this modify the method by using System.IO namespace classes as below..

fileInfo   = new System.IO.FileInfo(attachFileName);
fileSize = fileInfo.get_Length();

This will solve the issue and Batch will work without errors

Saturday, September 7, 2013

A generic error occurred in gdi+ (C#.Net - while saving image to a file from image control)

This error will be thrown if there is no write permissions to the folder to which the file will be saved.

Sol: Grant the write permissions to the folder. It will solve the issue