How can I prevent CompileAssemblyFromSource from leaking memory?
问题 I have some C# code which is using CSharpCodeProvider.CompileAssemblyFromSource to create an assembly in memory. After the assembly has been garbage collected, my application uses more memory than it did before creating the assembly. My code is in a ASP.NET web app, but I\'ve duplicated this problem in a WinForm. I\'m using System.GC.GetTotalMemory(true) and Red Gate ANTS Memory Profiler to measure the growth (about 600 bytes with the sample code). From the searching I\'ve done, it sounds