- Home /
Send Log file with email? ( IOException: Sharing violation on path) HELP
Hi, I want to send the output log file to my email at runtime, I used ByteSheep answer from this question and ArkaneX comment from this question to attach a txt file, now I was successful at sending txt files but how can I send the log file? I used this code to set the path to the log System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Unity\Editor\Editor.log"
and it does get the correct path, the problem is I'm getting
IOException: Sharing violation on path
when System.Net.Mail.Attachment attachment = new System.Net.Mail.Attachment(attachmentPath);
is called.
I think I need o close the log file first but is that even possible? maybe a solution would be duplicating the log file and sending the new one? would that work? if so how?
Any help is apprechiated.
Thanks,
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
not all lines of code running c# 0 Answers
Selecting Object From Top Causes NullReference 1 Answer
error on getint c# 0 Answers