I have a program that in turn accesses a DLL. It uses files in various ways, creating them, copying them, and setting them as attachments to the emailMessage object. I have a file in use error preventing a file from being overwritten.
Is there any tool or method to facilitate the process - for example, some kind of warning about creating / deleting pens containing a certain string? I looked at the process explorer, the process monitor (successor filemon), etc., but no luck.
I can continue the hunt, but thought there might be a better approach than continuing my informal research with code.
EDIT
Thanks for the comments. Regarding questions, the structure is a bit complicated. I have a client application that references the Engine DLL (also C #). Both of mine. The client creates instances of "attachments", each of which contains a link to a file for different files. The constructor for this capture refers to the file and places the copy in a temporary folder. Later, a set of "actions" creates an email - it adds each attachment as a "real" application to the EmailMessage object. At different times, I delete objects and set their references to zero, but if I do this too soon, I end up with null reference exceptions. If I do it too late, these damned things will be used! I am sure that I will be able to track down this particular error over time, but this prompted me to wonder if there is a useful standard method used by those who know. :)
source share