fsprojects / FsXaml

F# Tools for working with XAML Projects
http://fsprojects.github.io/FsXaml/
MIT License
172 stars 48 forks source link

Temporary files proliferate over time #24

Closed brianberns closed 8 years ago

brianberns commented 9 years ago

Using FsXaml over a long period of time causes a large number of files to accumulate in the user's temporary directory (c:\users\you\appdata\local\temp). These files occur in pairs, such as tmp2733.tmp and tmp2733.dll, where the .tmp file is 0 bytes and the dll is an assembly created by FsXaml. These files are not cleaned up by Visual Studio, and eventually cause slowness in the editor and errors. I recently found over 100,000 such files on a single machine.

cjstephen commented 8 years ago

I've just encountered this problem also. By the time it gets to ~300k of the dll and tmp files FSXaml starts reporting "File exists" with no indication of where. Visual Studio slows to a crawl as the number of files increases, starts to use try to use all available memory and crashes. The creation of these may have been accelerated by having several .xaml files in the same project.

ReedCopsey commented 8 years ago

@brianberns I am trying to look at this. As far as I can tell, it's a problem with generative type providers in general - so I'm not sure how to fix it. Am going to spend more time trying to figure out what can and should be done, though.

ReedCopsey commented 8 years ago

@brianberns Also added it as part of the task lists for #33

ReedCopsey commented 8 years ago

@brianberns and @cjstephen Please test https://www.nuget.org/packages/FsXaml.Wpf/2.0.0-beta2

I believe this is corrected in that version. Turns out it was a bug in the type provider API - see https://github.com/fsprojects/FSharp.TypeProviders.StarterPack/issues/97

brianberns commented 8 years ago

Seems to be fixed. Thanks for figuring this out, and thanks for FsXaml!

cjstephen commented 8 years ago

Excellent! Thanks for all your work - great to see version 2.0 is coming together. It's working well on a test project with no left over temporary files so I'll update a more complicated one and let you know if any problems crop up