On syntax
System.IO.File::Move(fileName, newFileName);
You get this error when using batch process:
"System.IO.IOException: The process cannot access the file because it is being used by another process"
Cause:
Possibility
A. Your AOS services is using user which have less security access to folders.
B. You read or access files but not closed yet.
Solution:
A. Add more security access to user who run the AOS services.
B. Closing File
Step-1
Close the files before
CodeAccessPermission::revertAssert();
Example:
io = new TextIO(filenameOp, "r");
io.read();
.....
io.finalized;
io = null;
CodeAccessPermission::revertAssert();
Step-2
Build Generate Increament CIL
Step-3
Close and Open AX.
Thanks for the post and its works for me.
ReplyDeleteHello thanks for your post but it does not work for me and I don't understand
ReplyDelete