public class Feature1EventReceiver : SPFeatureReceiver
{
public override void FeatureInstalled(SPFeatureReceiverProperties properties)
{
string sContextNull = (SPContext.Current == null) ? "Context is NULL" : "Context is OK";
string sFeatureNull = (properties.Feature == null) ? "Feature is NULL" : "Feature is OK";
// Some code here
...
...
{
}
該功能已成功安裝(日誌中沒有錯誤)。我的問題是,sContextNull總是返回「上下文爲NULL」。並且sFeatureNull總是返回「功能爲空」也是。有沒有辦法獲得不空值的SPContext.Current和properties.Feature?功能事件具有「空」對象
另一種方法FeatureActivated返回Context是NULL和特徵是行。 WTF?
謝謝!什麼是**屬性。功能**? – NieAR 2011-04-09 09:37:20
你可以嘗試調試事件http://blogs.msdn.com/b/chriskeyser/archive/2010/07/26/debugging-a-featureinstalled-event.aspx – djeeg 2011-04-09 09:43:08
這似乎與你的問題類似http: http://suguk.org/forums/thread/16667.aspx – djeeg 2011-04-09 09:43:34