I have an app that calls a Sub via the Thread class:
Dim POPThread As New Thread(AddressOf ProcessPOP)
POPThread.IsBackground = True
POPThread.Start()
The ProcessPOP sub creates a text file in the Windows temp folder (Path.GetTempPath). After writing some data to the file, it then tries to Kill() the file. This is generating an error:
Security error.
at Microsoft.VisualBasic.CompilerServices.ProjectData.GetAssemblyData(Assembly assem)
at Microsoft.VisualBasic.FileSystem.Kill(String PathName)
at SPAMGrinderProxy.SPAMGrinderProxy.ProcessPOP() in C:\Documents and Settings\Mike\My Documents\Visual Studio Projects\SPAMGrinderProxy\SPAMGrinderProxy.vb:line 756
Yet if I pause the program in debug mode, I can manually delete this file, so I know it's not being held open. Also, if I call the ProcessPOP sub without using a thread, this error does not occur.
Is there some type of thread security involved here that I don't know about I seem to recall reading something about that, but not sure.

"Security error" with threaded app
Ketaki
Jono378
Jubeh
Thanks.