SMTP Send is locking up my files – c#

How are you reading the files to create the email message? They should be opened as read-only, with a FileShare set to FileShare.ReadWrite… then they shouldn’t be locked. If you are using a FileStream you should also wrap your logic in the using keyword so that the resource is disposed properly. Update: I believe disposing … Read more

Error: Cannot access file bin/Debug/… because it is being used by another process

Ugh, this is an old problem, something that still pops up in Visual Studio once in a while. It’s bitten me a couple of times and I’ve lost hours restarting and fighting with VS. I’m sure it’s been discussed here on SO more than once. It’s also been talked about on the MSDN forums. There … Read more