SharePoint SPWeb.GetList 似乎会导致无限循环?

发布于 2024-11-28 17:23:30 字数 890 浏览 0 评论 0 原文

因此,我正在开发一个 SharePoint 2010 网站,并尝试实现内容类型更改传播。在这个过程中我似乎发现了一个奇怪的bug。我在 SharePoint 对象模型中调用方法的组合似乎导致了无限循环。您可以在这里看到代码(我认为有点太大,无法直接在此处发布): http://pastebin.com/U0qbLxpS< /a>.关键行位于第 13 行。将该行注释掉会导致子站点的无限循环(从第一个站点开始)。如果我取消注释该行,事情似乎工作正常。有谁对这个错误有任何经验或有任何建议吗?任何人都可以为我复制这个问题吗?我试图使用 SPWeb.GetList("blah") 而不是直接使用 SPWeb.List["blah"] 因为 GetList 是访问列表的推荐方法(根据我读过的所有内容)。但这个错误有点奇怪,将迫使我在那里留下完全不相关的代码行(这让我感觉有点奇怪)。

我的测试站点结构是这样的: http://localhost (主站点)和 http://localhost/ASubSite。无限循环发生在 http://localhost/ASubSite 上,并且只是不断将 /ASubSite 追加到末尾并继续循环。

感谢您提供的任何希望。如果有人可以复制这个,那就太好了。那么也许我可以向微软提交一个关于此的错误。否则,也许这只是我正在做的事情与我的网站结合起来的一些奇怪的组合。

So, I'm working on a SharePoint 2010 site that I developed, and I am trying to implement content type change propogation. During this process I seem to have found a strange bug. It seems my combination of calling methods in the SharePoint object model causes an infinite loop. You can see the code here (a little too large to post directly here I think): http://pastebin.com/U0qbLxpS. The key line there is on line 13. Leaving that line commented out results in an infinite loop of sub sites (starting at the first one). If I uncomment that line though, things seem to work fine. Does anyone have any experience with this bug or have any advice? Can anyone duplicate this issue for me? I was trying to use SPWeb.GetList("blah") instead of using SPWeb.List["blah"] directly as GetList is the recommended way to get access to a list (according to everything I have read). But this bug is a bit odd and is going to force me to leave a completely unrelated line of code in there (which leaves me feeling a bit strange).

My test site structure is this: http://localhost (main site) and http://localhost/ASubSite. The infinite loop happens on http://localhost/ASubSite and just keeps appending /ASubSite to the end and continuing the loop.

Thanks for any hope you can offer. If anyone can duplicate this, it would be great. Then maybe I can submit a bug to Microsoft about this. Otherwise, maybe this is just some strange combination of things I am doing combined with my site.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文