lundi 18 février 2019

Unload assembly?

I have an application that allows the end user to write some C#/VB.Net code and compile it.

Whenever the user modifies his code, he should click compile in order to check whether his code is correct or not. That means when running my application, he may hit compile several times.

I'm quite worried about the memory because whenever the user clics compile a new assembly is generated in memory. So I was wondering if there is a way to unload the previous assembly before a new compile operation ?

Here is my code :

Dim Parameters As New CompilerParameters
Dim Results As CompilerResults

Parameters.GenerateInMemory = True
Parameters.GenerateExecutable = False

Dim Provider As New VBCodeProvider
Results = Provider.CompileAssemblyFromSource(Parameters, CodeString)    

Thanks.





Aucun commentaire:

Enregistrer un commentaire