2013-05-09 21 views
0

我正試圖在我的網站上獲得最新版本的CropImage.Net。如何獲取CropImage.Net的工作?

我已經加入ImageResizer.dll和Imazen.Crop.dll到我的項目,我能夠運行ImageResizer診斷頁,它不會報告任何錯誤,只有以下警告:

2期檢測到: (警告):若要在此處看到其他錯誤,請執行圖像大小調整請求。 (警告):NoCache僅用於開發用途,不能擴展到生產用途。 添加DiskCache或CloudFront的用於生產用途

我已經註冊的組件,並增加了控制頁面:

<%@ Register Assembly="Imazen.Crop" Namespace="Imazen.Crop" TagPrefix="ic" %> 

<ic:CropImage ID="CropImage1" runat="server" CanvasHeight="300" ImageID="Image1" CanvasWidth="300" /> <br /> 

一切看起來很好,但是當我嘗試訪問的頁面出現以下錯誤:

描述:執行當前Web請求期間發生未處理的異常。請查看堆棧跟蹤以獲取有關該錯誤的更多信息以及源代碼的位置。

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.] 
    Imazen.Crop.CropImage.AddFileReferences() +1917 
    Imazen.Crop.CropImage.CreateChildControls() +88 
    System.Web.UI.Control.EnsureChildControls() +188 
    System.Web.UI.Control.PreRenderRecursiveInternal() +59 
    System.Web.UI.Control.PreRenderRecursiveInternal() +221 
    System.Web.UI.Control.PreRenderRecursiveInternal() +221 
    System.Web.UI.Control.PreRenderRecursiveInternal() +221 
    System.Web.UI.Control.PreRenderRecursiveInternal() +221 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4296 

對我的錯誤有何建議或想法?

感謝,

埃爾登

+0

這裏是一個最新版本零件。 http://imagecropping.codeplex.com/ – Cem 2013-05-30 15:28:59

回答

0

這可能是晚了一點,但我設法通過不包括ASP重現你的錯誤:圖像。

正如你所看到的,CropImage控制參考圖像的ID:

<ic:CropImage ID="CropImage1" runat="server" CanvasHeight="300" ImageID="Image1" CanvasWidth="300" /> <br /> 

添加圖像用相同的ID解決了這個問題:

<asp:Image ID="Image1" runat="server" ImageUrl="images/328.jpg" />