[英]How can I set C#'s gcAllowVeryLargeObjects to true in VS2022 **without** using an App.config file?
我希望能夠以編程方式(或至少使用項目屬性)將gcAllowVeryLargeObjects
設置為 true。 我知道我可以使用 App.config 文件,但這非常難看,因為它需要為主要可執行文件創建一個單獨的文件,然后需要將其與可執行文件一起傳遞。
我已經對Environment.GetEnvironmentVariable("gcAllowVeryLargeObjects")
和Environment.GetEnvironmentVariable("COMPlus_gcAllowVeryLargeObjects")
進行了試驗,但它不會打印出任何內容,即使我使用配置文件將 gcAllowVeryLargeObjects 設置為 true 也是如此。
如果這不起作用,我也不希望Environment.SetEnvironmentVariable()
起作用,而且確實不起作用。
我仔細看了VS2022的Project屬性,也沒有什么可看的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.