SharePoint project无法找到静态属性的getter和setter方法
我有一个类库项目,其中有一个具有属性的类:SharePoint project无法找到静态属性的getter和setter方法,sharepoint,sharepoint-2010,properties,static-members,Sharepoint,Sharepoint 2010,Properties,Static Members,我有一个类库项目,其中有一个具有属性的类: public class MyClass { public static string MyProperty { get; set; } } 以及引用类库项目的SharePoint 2010项目,该项目有一个应用程序页面: public partial class MyPage : LayoutsPageBas
public class MyClass
{
public static string MyProperty
{
get;
set;
}
}
以及引用类库项目的SharePoint 2010项目,该项目有一个应用程序页面:
public partial class MyPage : LayoutsPageBase
{
protected void Page_Load(object sender, EventArgs e)
{
MyNamespace.MyClass.MyProperty = "ABC";
}
}
上面的代码给了我一个例外,我完全猜不出原因 例外情况: 找不到方法:“Void” MyNamespace.MyClass.set_MyProperty(System.String)“”。 描述:未处理的异常 在执行过程中发生 当前web请求。请检查 有关堆栈跟踪的详细信息,请参阅 错误及其来源 密码 例外情况详情: System.MissingMethodException:方法 未找到:'无效 MyNamespace.MyClass.set_MyProperty(System.String)“”
我在这里做错了什么?您可能安装了一个没有“MyProperty”成员的类库版本。查看GAC和Bin,确保只安装了DLL的当前版本
确保已回收应用程序池、计时器服务以及内存中可能有缓存版本的任何其他内容。是的,我现在已在类库项目中添加了预构建和后构建命令。