There is a temp .3dm file which i’m writing with WriteFile(path, options) method. It return true, and after that i want to delete the temp file with System.IO.File.Delete(path) and it throws an exception.
Exception Message:
“The process cannot access the file ‘…Temp\RhinoTest_tmp.3dm’ because it is being used by another process.”
Rather than calling the document’s WriteFile member and having to deal with it’s file locking, you might just script the SaveAs command. Here is an example.
I checked your suggestion, my problem is that i’m calling the Doc.WriteFile from a service class which is saving the file temporarily and then wants to delete it. This wasn’t a problem in Rhino 5 and is a problem in Rhino 6. I think this script.runner solution is not meant to used like that. So any other suggestions why it locks longer then it used to, or how to get around the locking issue?