The .NET CLR Hosting API allows a native application to host and control the .NET Common Language Runtime (CLR). This enables:
1. Customizing the CLR's runtime behavior through policies, assembly loading, memory management, and more.
2. Monitoring and debugging CLR applications through profiling and debugging APIs.
3. Integrating the CLR into native applications and environments like device drivers through a hosting interface.
Report
Share
Report
Share
1 of 20
More Related Content
Евгений Напрягло ".NET Framework Hosting API Overview"
9. Policy Management
ICLRPolicyManager IHostPolicyManager
Enables the host to specify the way program failures are handled, to
support different reliability requirements.
NoAction
ThrowException
AbortThread
RudeAbortThread
UnloadAppDomain
RudeUnloadAppDomain
ExitProcess
FastExitProcess
RudeExitProcess
DisableRuntime
NonCriticalResource
CriticalResource
FatalRuntime
OrphanedLock
StackOverflow
ThreadAbort
ThreadRudeAbortInNonCriticalRegion
ThreadRudeAbortInCriticalRegion
AppDomainUnload
AppDomainRudeUnload
ProcessExit
FinalizerRun
ActionsFailures
Events
10. Host Protection
Enables the host to enforce its own programming model, by
preventing the use of specified types or members.
ICLRHostProtectionManager
Reflection
Licensing
Synchronization
UI Components
11. Thread Pool Management
Enables the host to implement its own thread pool for the runtime
to use.
IHostThreadPoolManager
GetAvailableThreads
GetMaxThreads
GetMinThreads
QueueUserWorkItem
SetMaxThreads
SetMinThreads
12. I/O Completion
IHostIoCompletionManager
Enables the host to implement its own implementation of
asynchronous input/output.
ICLRIoCompletionManager
CLR
Host
IHostIoCompletionManager
ICLRIoCompletionManager
IO Operations Calls
Results & Feedback
13. Profiling
• Class loading and unloading
events.
• Thread creation and destruction
events.
• Function entry and exit events.
• Exceptions.
• Transitions between different
runtime contexts.
• Information about runtime
suspensions.
• Information about the runtime
memory heap and garbage
collection activity.
Application
For
Profiling
CLR
HOST IPC Transport
Profiler
User
Interface
Profile Target Profiler
ICorProfilerInfo
ICorProfilerCallback
18. Windows User Mode Driver Framework
Virtual Printer Driver
CLR Host
.NET Data
Converter
.NET Data
Converter
.NET Data
Converter
Native
Native
Native
19. CLR Hosting vs COM Integration
Simple Programming Model
Fully Managed
Good Performance
Flexible Programming Model
High Reliability
Tailored Integration with Native Services
Native Programming Environment
Low Reliability
COM Infrastructure Availability
Complex Diagnostics
Strange Errors