获取所有 NodieId 或所有 NodeAliasPath 的最佳方法是什么 API 7

What's best way to get all NodieIds or all NodeAliasPaths API 7

我收集了 NodeId(其中 22,000 个)到 List 并将它们传递给

tree.SelectSingleNode(NodeID) // Kentico API7

我是否使用

tree.SelectSingleNode(NodeID) 

NodeAliasPath

的等价物
tree.SelectSingleNode(CMSContext.CurrentSiteName, aliaspath, culture) 

两者都返回一个允许操作节点数据的节点,我得到了 任一行的内存错误:

tree.SelectSingleNode(NodeID) 

tree.SelectSingleNode(CMSContext.CurrentSiteName, aliaspath, culture)

报错是代码还是环境问题?

错误信息如下:

Managed Debugging Assistant 'FatalExecutionEngineError' has detected a problem in 'C:\Users\xxxxxxx\Documents\Visual Studio 2013\Projects\ConsoleApplication4\ConsoleApplication4\bin\Debug\ConsoleApplication4.vshost.exe'.

Additional information: The runtime has encountered a fatal error. The address of the error was at 0x005228e7, on thread 0x5330. The error code is 0x80131623. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

看来您获取的信息是正确的。问题是当将所有数据存储在内存中时,您的节点太多并且 运行 内存不足。我要做的是获取数据并分批处理。如果您 运行 正在使用多租户环境,您还可以在 where 子句中指定一个 SiteID。您还可以指定要接收或修改的列,这也将有助于您返回的数据量。