在Linux上附加除錯器會導致PDF崩潰、掛起或空白
在Linux上,將除錯器附加到您的應用程式可能會導致IronPDF掛起、返回空白PDF或靜默崩潰。 無論Linux發行版或.NET版本如何,這種情況都會在附加除錯器時發生。
IronPDF透過CEF(Chromium Embedded Framework)進行渲染,預設情況下會產生分離的沙盒子程式來處理渲染。 在Linux上,這些子程式被鎖定,所以不能用ptrace追蹤,一次只能有一個追蹤器。附加除錯器會與Chromium啟動其沙盒子程式的方式發生衝突,導致渲染器子程式掛起。 您的應用程式會將這視為掛起、空白PDF或靜默崩潰。
解決方案
建議:啟用單進程模式。 在應用程式啟動期間,在首次使用IronPDF之前設定它:
IronPdf.Installation.SingleProcess = true;IronPdf.Installation.SingleProcess = True單進程模式在主進程中保持渲染,因此沒有沙盒子程式與除錯器發生衝突。
因為該設置禁用了CEF的進程隔離,並且在負載下不太穩定,因此保持在生產環境之外。 將它範圍限定到除錯構建,因此它永遠不會被釋出交付:
#if DEBUG
IronPdf.Installation.SingleProcess = true;
#endif

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.