The process cannot access the file ‘C:\Users\xx\Desktop\Original Application\XMLshredapp\xmldocs\xmltempfile0001.xml’ because it is being used by another process.
Here’s the code:
Dim transformer As New System.Xml.Xsl.XslCompiledTransform()
transformer.Load(workingdirectory & "\xslttempfile" & CStr(c) & ".xslt")
transformer.Transform(fname, fname)
When doing the TRANSFORM, I want to transform the file and output the same name. I think this might be the issue here. Any tips?
Yes, given that transforms can potentially work over large files, I’d expect it to try to stream the input.
Transform to a new file, then delete the old file, then rename the new file to take the place of the old one.