I've been having a problem lately where I've started getting this stack trace from PLC tag... I manufactured this one by opening a copy of the process, but the error is usually access denied (I suspect because I'm running in the Program Files directory).
Is there a way around this apparent dumping of the dll to disk? Can I force it to write into a temp file location where I do have access?
The process cannot access the file 'C:\<snipped out path>\plctag.dll' because it is being used by another process.
at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.IO.File.InternalWriteAllBytes(String path, Byte[] bytes)
at System.IO.File.WriteAllBytes(String path, Byte[] bytes)
at libplctag.NativeImport.LibraryExtractor.ExtractAppropriateLibraryToDirectory(String outputDirectory)
at libplctag.NativeImport.LibraryExtractor.Init(Boolean forceExtract)
at libplctag.NativeImport.plctag.ExtractLibraryIfRequired()
at libplctag.NativeImport.plctag.plc_tag_create(String lpString, Int32 timeout)
at libplctag.NativeTag.plc_tag_create(String lpString, Int32 timeout)
at libplctag.NativeTagWrapper.Initialize()
at libplctag.NativeTagWrapper.InitializeIfRequired()
at libplctag.NativeTagWrapper.Read()
at libplctag.Tag.Read()
at libplctag.Tag`2.Read()
<snipped out my code>