My script is running successfully when tested in the Workflow Designer's Script Editor, but is failing when it runs as part of a workflow. I am trying to read a file as below in the script editor.
long length = 0;
var path = Path.GetFullPath(@"C:\Users\test.pdf");
FileStream fileStream = File.OpenRead(path);
length = (fileStream.Length);