每当我尝试在 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("myemail@company.com"),
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 部件时仍然会收到错误消息。
有没有其他人处理过这样的问题?如果需要,我可以提供更多信息或代码片段。