Debugging executed CodeDom?
I am using codedom to execute some code. Is it possible to stop somehow the execution? here is how i run the code:
Dim SourceCode as String="... some VB code"
Dim MyProvider As New VBCodeProvider
Dim cp As New CompilerParameters
Dim cr As CompilerResults = MyProvider.Comp开发者_如何学JAVAileAssemblyFromSource(cp, SourceCode)
Dim methInfo As MethodInfo = cr.CompiledAssembly.GetType("Class1").GetMethod("Main")
methInfo.Invoke(Nothing, Nothing)
my idea is to put this in a threadworker and if I need to stop it, i stop the thread... but is there a better solution maybe? Thanks :)
精彩评论