Search Error after Upgrade

Topics: ASP.NET 2.0
Dec 23, 2007 at 10:47 PM
Edited Dec 23, 2007 at 10:48 PM
After upgrading to 1.3 I receive the error below. I did not replace the AppData directory when upgrading - is there a data structure change that caused this casting issue? If that is the case, what is the proper upgrade path for the AppData directory?

Error: System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Uri'.

Stack Trace:
InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Uri'.
ASP.searchaspx._DataBind__control5(Object sender, EventArgs e) +164
System.Web.UI.Control.OnDataBinding(EventArgs e) +99
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +206
System.Web.UI.Control.DataBind() +12
System.Web.UI.Control.DataBindChildren() +204
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +216
System.Web.UI.Control.DataBind() +12
System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +130
System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +454
System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +53
System.Web.UI.WebControls.Repeater.DataBind() +72
search.BindSearchResult(String searchTerm, Boolean includeComments) +376
search.Page_Load(Object sender, EventArgs e) +272
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
System.Web.UI.Control.OnLoad(EventArgs e) +99
BlogEngine.Core.Web.Controls.BlogBasePage.OnLoad(EventArgs e) +38
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436

Dec 24, 2007 at 10:04 AM
Same thing here.

Ligne 40 : <span class="text"><%# GetContent((string)Eval("Description"), (string)Eval("Content")) %></span>
Ligne 41 : <span class="type" runat="server" id="type" />
Ligne 42 : <span class="url"><%# ShortenUrl((Uri)Eval("RelativeLink")) %></span>
Ligne 43 : </div>
Ligne 44 : </ItemTemplate>

search.aspx on line 42.
Dec 24, 2007 at 4:28 PM
I realized I had customized my search after seeing your post. Thanks for your reply. A few lines changed in the 1.3 releases in the search.aspx and search.aspx.cs. I would recommend comparing the two files in a program like WinMerge to see the changes. The error I recieved was directly related to the following line (though I probably would have received additional errors after fixing this as there are several changes:

Line 42: <span class="url"><%# ShortenUrl((Uri)Eval("RelativeLink")) %></span>

Line 42: <span class="url"><%# ShortenUrl((String)Eval("RelativeLink")) %></span>

Hope this helps. Thanks!
Dec 24, 2007 at 9:03 PM
Excellent !
I haven't made change on these pages but apparently I've missed them when I have done the ftp... stupid me :)

Thanks. It is now working.