Hi; Thanks for the answer.
I just tested that (comment PruneCache in Forms, add a dotNetProjectResolver at the main closing, set its CacheFolder, call the PruneCache()), and that didn't make a difference.
I explained that there could be multiple instances of the SyntaxEditor/DotNetProjectResolver at the same time, but during all my tests, I only opened 1 of them and got the problem:
- run the application, load a custom project (which containing C# codes)
- open a form to create the cache
- close the form ( - PruneCache :) )
- close the app:
- __ + new DotNetProjectResolver, set the CacheFolder, call PruneCache
- __ Deletion of files in the Cache Folder, throw IOException file lock by other proccess on mscorlib.210f58f6.Documentation.dat (and only on it)
So i tried to declare/use only one DotNetProjectResolver in the whole application (in order to have this only one reference dispose/prunecache and delete the folder at this unique point), passing it to forms through a static class.
Like it, the cache is filled as soon as a project is load, i don't need to open a form any more to reproduce my problem:
- run the application
- load a custom project (which containing C# codes)
- -> new DotNetProjectResolver, set the CacheFolder
- close the app :
- --> call Dispose / PruneCache,
- --> Deletion of files in the Cache Folder, throw IOException file lock by other proccess on mscorlib.210f58f6.Documentation.dat (and only on it)
I finally did 2 things:
- add a CodeEditor.Document.LangageData = null when closing a form (to be sure to unreference the DotNetProjectResolver from this instance)
- comment the AddExternalReferenceForMSCorLib()
and ... IT WORKS !??!
When i un-comment the AddExternalReferenceForMSCorLib(), I have the problem again.
I reproduce the problem in the provided sample (the TestApplication - MainForm) :
- adding a AddExternalReferenceForMSCorLib() before the AddAllAssembliesInAppDomainAsExternalReferences()
- add a Directory.Delete(cachefolder, true) right after the PruneCache()
- get the same IOException on the same file :)
I suppose that when i added this, i had a good reason, but i really don't remember why i added it (2009... it dates).
So, for the moment, i have commented the AddExternalReferenceForMSCorLib() and will cross my fingers in the wait for feedbacks for any dysfunctionning...
[Modified 6 years ago]
I am. I was not then I came to be. I cannot remember NOT being.