English 中文(简体)
表达式树深度限制
原标题:Expression tree depth limitations

我正面临一个在 Lambda Expression of type 表达式 & lt; Func< MyType, bul> & gt; 深度约400 。 低值不会造成任何问题。 我找不到关于这种限制的任何问题。 有人能澄清这一点吗? 我可以提高这个限制吗?

upd: Sorry, forgot to mention, I m getting StackOverflowException:

An unhandled exception of type System.StackOverflowException occurred in System.Core.dll {Cannot evaluate expression because the current thread is in a stack overflow state.}

最佳回答

您正合法地在堆叠大小上进入一个限制( 虽然我怀疑400+项 em lambda 的智慧 ) 。 最容易绕过的方法就是创建一条新的线条, 专门用更大的堆叠来进行编组, 使用以堆叠大小为缩略图的线条构造器 : < a href="http://msdn. microsoft. com/ en- us/library/ms149581..aspx < /a> >http://msdn. microsoft. com/ en- us/library/ ms149581. aspx < /a>

在这条线索中调用汇编, 必要时增加堆叠大小参数。 我相信是字节, 默认值大约为 1048576, 所以从那里开始, 按需要提高它 。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签