Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load CLR into process

Tags:

.net

clr

I have some question which puzzled me for a long time.

  1. What is the relationship between CLR and one process created by OS?
  2. What steps the CLR is loaded when we double-click an "Console Application" or "Windows Forms Application"?
  3. I found two methods: _CorExeMain() and _CorBindToRuntimeEx(). What's the role of them?
like image 481
Leo Zhang Avatar asked Sep 17 '25 19:09

Leo Zhang


1 Answers

Please see Hosting the Common Language Runtime, Loading the Common Language Runtime into a Process, _CorExeMain Function, CorBindToRuntimeEx Function.

I think the basic answer is, the CLR must run in a process (host). If you "double-click", a process is created (initally purely unmanaged) then the CLR is loaded into the process (e.g. with CorBindToRuntimeEx).

like image 155
Matthew Flaschen Avatar answered Sep 20 '25 10:09

Matthew Flaschen