How to increase the stack size of an ASP.NET Core binary (32 bit)?
Asked Answered
L

2

6

Is it possible to increase the stack size of an ASP.NET core 2 binary? I have to use a 32 bit COM interop component which happens to smash the stack under some defined conditions. It's not an infinite recursion, just a workload that happens to scratch the limit when the largest possible data set is requested, so increasing the stack might be an acceptable fix.

Modifiying the stack size via EDITBIN only works if applied to dotnet.exe directly, which obviously is not a preferred solution.

Loisloise answered 6/4, 2018 at 15:36 Comment(1)
You could create a thread to run your component, and specify the stack size at that moment: learn.microsoft.com/en-us/dotnet/api/…Gaut
M
1

For .Net 5 default stack size can set by environment variable COMPlus_DefaultStackSize=100000. Value in HEX

Misinform answered 13/10, 2021 at 16:23 Comment(0)
M
0

Starting with .NET Core 3.0, the output of a build is an .exe file on Windows platform. We can just apply editbin on the exe before or after we publish it. This works fine if we run the web application out-of-process. I have tested it. Obviously with inprocess there is no other solution than editbinning worker process.

Meatiness answered 1/2, 2019 at 4:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.