修改 MOSS Web 部件时出错

发布于 2024-09-12 01:22:24 字数 2783 浏览 6 评论 0原文

每当我尝试在 sharepoint 2007 中编辑自定义 Web 部件的共享属性时,都会收到以下错误:

Exception has been thrown by the target of an invocation.
  at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
  at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
  at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
  at Microsoft.SharePoint.WebPartPages.ExtendedPropertyInfo.GetValue(Object target, Object[] indexValues)
  at Microsoft.SharePoint.WebPartPages.PropertySheetProperty.get_Value()
  at Microsoft.SharePoint.WebPartPages.PropertySheetProperty.get_IsNull()
  at Microsoft.SharePoint.WebPartPages.PropertySheetProperty..ctor(WebPart targetWebPart, SPWebPartManager webPartManager, PropertyInfo pi)
  at Microsoft.SharePoint.WebPartPages.PropertySheetProperties.GetProperties(WebPart targetWebPart, SPWebPartManager manager, Boolean inPersonalizationMode, IPropertySheetPropertiesFilter filter)
  at Microsoft.SharePoint.WebPartPages.CustomPropertyToolPart.CreatePropertyGrid()
  at Microsoft.SharePoint.WebPartPages.CustomPropertyToolPart.CreateChildControls()
  at System.Web.UI.Control.EnsureChildControls()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

我的 Web 部件中确实有一些自定义属性,它们为表单生成的通知电子邮件设置电子邮件地址。例如:

    [WebBrowsable(true),
    Personalizable(true),
    DefaultValue("[email protected]"),
    Category("Email Properties"),
    Microsoft.SharePoint.WebPartPages.WebPartStorage(Microsoft.SharePoint.WebPartPages.Storage.Shared),
    Microsoft.SharePoint.WebPartPages.FriendlyName("Email Addresses (separate multiple emails with a comma):"),
    Description("Please enter the email addresses for those that should be notified when an incident takes place at a Corporate location.")]
    public string CorpMessageEmailAddresses { get; set; }

但是,即使注释掉了这些属性,我在尝试修改 Web 部件时仍然会收到错误。

还有其他人处理过这样的问题吗?如果需要,我可以提供更多信息或代码片段。

Whenever I try to edit the shared properties of my custom web part in sharepoint 2007, I get the following error:

Exception has been thrown by the target of an invocation.
  at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
  at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
  at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
  at Microsoft.SharePoint.WebPartPages.ExtendedPropertyInfo.GetValue(Object target, Object[] indexValues)
  at Microsoft.SharePoint.WebPartPages.PropertySheetProperty.get_Value()
  at Microsoft.SharePoint.WebPartPages.PropertySheetProperty.get_IsNull()
  at Microsoft.SharePoint.WebPartPages.PropertySheetProperty..ctor(WebPart targetWebPart, SPWebPartManager webPartManager, PropertyInfo pi)
  at Microsoft.SharePoint.WebPartPages.PropertySheetProperties.GetProperties(WebPart targetWebPart, SPWebPartManager manager, Boolean inPersonalizationMode, IPropertySheetPropertiesFilter filter)
  at Microsoft.SharePoint.WebPartPages.CustomPropertyToolPart.CreatePropertyGrid()
  at Microsoft.SharePoint.WebPartPages.CustomPropertyToolPart.CreateChildControls()
  at System.Web.UI.Control.EnsureChildControls()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Control.PreRenderRecursiveInternal()
  at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

I do have some custom properties in my web part, which set the email addresses for notification emails that are generated by the form. An example of this is:

    [WebBrowsable(true),
    Personalizable(true),
    DefaultValue("[email protected]"),
    Category("Email Properties"),
    Microsoft.SharePoint.WebPartPages.WebPartStorage(Microsoft.SharePoint.WebPartPages.Storage.Shared),
    Microsoft.SharePoint.WebPartPages.FriendlyName("Email Addresses (separate multiple emails with a comma):"),
    Description("Please enter the email addresses for those that should be notified when an incident takes place at a Corporate location.")]
    public string CorpMessageEmailAddresses { get; set; }

However, even with these properties commented out, I still get an error when trying to modify the web part.

Has anyone else ever dealt with an issue like this? I can provide more information or code snippits, if needed.

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

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

发布评论

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

评论(1

一杆小烟枪 2024-09-19 01:22:24

好吧,我昨晚很晚才发现这一点……这是隐藏在异常中的典型 MS 异常。显示的异常不是原因,而是最后发生的异常。真正的例外是与我的 ViewState 变量有关的问题。我在 get & 周围放了一个 try/catch 。设置好,现在一切正常!

直到今天早上我才看到你的评论,kbrimington...感谢你的帮助!

Ok, I figured this out late last night...it was a typical MS exception hidden within an exception. The exception shown was not the cause, but rather the last exception to occur. The real exception was an issue having to do with my ViewState variables. I put a try/catch around the get & set and now everything works well!

I didn't see your comments until this morning kbrimington...thanx for trying to help out!

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