2015-03-19 40 views
1

當我安裝Sitecore的更新包7.2,然後Object reference not set to an instance of an object error顯示出來,並沒有安裝該軟件包:對象引用未設置到對象錯誤顯示的實例在Sitecore的7.2更新用

Server Error in '/' Application. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.] Sitecore.Update.InstallUpdatePackage.WriteMessage(Object message, Exception ex, Level level, Boolean isCommandText) +501
Sitecore.Update.InstallUpdatePackage.WriteSupportInstructions(String historyPath, Exception ex) +807
Sitecore.Update.InstallUpdatePackage.OnLoad(EventArgs e) +1055
System.Web.UI.Control.LoadRecursive() +70
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3177

請通過以下去詳情還有:

Exception details: System.Exception: Cannot execute post installation action because installation data not found. at Sitecore.Update.InstallUpdatePackage.ExecutePostStep(MetadataView view) at Sitecore.Update.InstallUpdatePackage.OnLoad(EventArgs e)

+0

是關於最初的7.2包,Sitecore 7.2 rev。 140228.update ?,分析任務運行良好?在臨時文件夾中您可以找到一個日誌文件,您可以看到最新的步驟,因此您知道哪個文件/項目更新文件。 – 2015-03-19 09:03:43

回答

1

這是一個非常常見的錯誤,可能是由於各種原因而發生的。根本原因實際上取決於您遇到的具體情況。

如果您正在使用API​​或調用可能返回null的方法,那麼正確處理這一點很重要。主要方法上面可以在該NullReferenceException異常不應該被用戶看到這樣一種方式進行修改:

static void Main(string[] args) 
{ 
    var exampleClass = new ExampleClass(); 
    var returnedClass = exampleClass.ExampleMethod(); 

    if (returnedClass == null) 
    { 
     //throw a meaningful exception or give some useful feedback to the user! 
     return; 
    } 

    returnedClass.AnotherExampleMethod(); 
} 

請檢查here瞭解詳情。

+0

我也發佈了有問題的錯誤追蹤。請仔細閱讀。 實際上,我們正在升級sitecore,因此我們無法深入並更改您提及的代碼。 – user3913751 2015-03-19 07:07:36

+0

只是處理空值 – MSTdev 2015-03-19 07:20:39

相關問題