sharepoint 2010:沙盒 Web 部件错误

发布于 2024-09-27 14:05:28 字数 311 浏览 3 评论 0原文

我只是想在 Visual Studio 2010 中创建一个简单的 Web 部件(适用于 Sharepoint 2010) 我创建了一个空的共享点项目,然后添加了一个 Web 部件。我写了一个简单的代码(从一本带有示例的书中粘贴它) 我构建项目,然后部署它(没有错误)

然后,当我转到要添加 Web 部件的网页时,在添加它时收到此错误:

“沙盒代码包装器抛出了未处理的异常” 部分信任应用域中的执行方法: $Resource:core,ImportErrorMessage;"

有什么想法吗? 如果需要,我会发布 .cs 文件的代码

谢谢

I was just tryng to create a simple webpart in visual studio 2010 (for sharepoint 2010)
I created an empty sharepoint project, then added a webpart. I wrote a simple code (pasting it from a book with examples)
I Build the project, then deploy it (without errors)

Then when i go to the webpage where i want to add my webpart, i get this error when adding it:

"unhandled exception was thrown by the sandboxed code wrapper's
Execute method in the partial trust app domain:
$Resource:core,ImportErrorMessage;"

Any idea about it?
If it's needed i'll post the code of the .cs file

Thanks

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

治碍 2024-10-04 14:05:28

我不知道为什么,但第二次尝试成功了
我不能确切地说出第一次出了什么问题,但现在我再也没有遇到过同样的问题

i don't know why but the second try worked
i can't say exactly what went wrong the first time, but i never get the same problem now

眼泪也成诗 2024-10-04 14:05:28

我已经弄清楚了,它与随项目一起生成的清单和功能 xml 文件有关。

当你开始时,你应该有一个像这样的名称空间。

ASMLab4.DisplayWebPartWithProxy.DisplayWebPartWithProxy

但由于某种原因,在这些 xml 文件中,它被添加为

ASMLab4.DisplayWebPartWithProxy.DisplayWebPartWithProxy.

“带有额外的”。” (点)。
修复打开像记事本++这样的东西,在项目中进行搜索,首先查找

ASMLab4.DisplayWebPartWithProxy.DisplayWebPartWithProxy..

它们应该在清单/功能文件中。更改为单个点,因此应该执行类似

<type name="ASMLab4.DisplayWebPartWithProxy.DisplayWebPartWithProxy.DisplayWebPartWithProxy, $SharePoint.Project.AssemblyFullName$" />

“下一步”搜索单个点的操作。安全列表中应该有一个,删除单个点。再次尝试部署 - 应该没问题。

I've figured this one out, its something to do with the manifest and features xml files that are generated along with the project.

When you start you should have a namespace like this.

ASMLab4.DisplayWebPartWithProxy.DisplayWebPartWithProxy

But for some reason in those xml files it's added as

ASMLab4.DisplayWebPartWithProxy.DisplayWebPartWithProxy.

With an extra '.' (dot).
The fix open something like notepad++ do a search through the project and at first look for

ASMLab4.DisplayWebPartWithProxy.DisplayWebPartWithProxy..

They should be in the manifest/features files. Change to a single dot so should have something like

<type name="ASMLab4.DisplayWebPartWithProxy.DisplayWebPartWithProxy.DisplayWebPartWithProxy, $SharePoint.Project.AssemblyFullName$" />

Next do a search for a single dot. There should be one in the safe list, remove the single dot. Try the deployment again - should be ok.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文