Tag: clr hosting

托管clr和捕获线程exception

我正在尝试编写一个可以加载托管插件的插件系统。 如果有任何exception,主机应该能够卸载插件。 对于我的poc,我在C#中有一个示例代码库,它会抛出这样的exception…… public static int StartUp(string arguments) { Console.WriteLine(“Started exception thrower with args {0}”, arguments); Thread workerThread = new Thread(() => { Console.WriteLine(“Starting a thread, doing some important work”); Thread.Sleep(1000); throw new ApplicationException(); } ); workerThread.Start(); workerThread.Join(); Console.WriteLine(“this should never print”); return 11; } 然后我有这样的原生win32控制台应用程序.. int _tmain(int argc, _TCHAR* argv[]) { ICLRMetaHost *pMetaHost = […]