unable to cast object of type 'Microsoft.SharePoint.SPsite' to type 'Microsoft.SharePoint.SPWeb'

来源:互联网 发布:vb comdlg32.ocx 编辑:程序博客网 时间:2024/05/19 03:23

ERROR:unable to cast object of type 'Microsoft.SharePoint.SPsite' to type 'Microsoft.SharePoint.SPWeb' during deploy MOSS 2010 solution

 

原因:程序中有涉及到spweb的引用,注释掉就可以了。

            //SPSite curSite = (SPSite)properties.Feature.Parent;
            //SPWeb curWeb = curSite.RootWeb;
            SPWeb curWeb = (SPWeb)properties.Feature.Parent;

如果是想发布到web上,将下面的scope设置为web

原创粉丝点击