4.3.1885 error with external widget templates

Posted by Community Admin on 04-Aug-2018 22:00

4.3.1885 error with external widget templates

All Replies

Posted by Community Admin on 20-Nov-2011 00:00

Hello, I've implemented an external widget template for our blog.  This was working great in 4.3.1873, but when we upgraded to 4.3.1885, the control stopped rendering.  It seems that it is still requesting the 4.3.1873 version of the "telerik.Sitefinity.Model" DLL.

I've tried rebuilding, resetting IIS, clearing ASP.NET Temporary files, changing from CodeBehind to CodeFile and vice-versa, and anything else I could think of, but the error won't go away.  The control partially renders before displaying "Error parsing the template" 

Here is the actual log:

Message: HandlingInstanceID: 02e95cbf-c105-4185-a0ae-95565ea44b28
An exception of type 'System.IO.FileLoadException' occurred and was caught.
---------------------------------------------------------------------------
11/20/2011 21:50:45
Type : System.IO.FileLoadException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Could not load file or assembly 'Telerik.Sitefinity.Model, Version=4.3.1873.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source : SitefinityWebApp
Help link :
FileName : Telerik.Sitefinity.Model, Version=4.3.1873.0, Culture=neutral, PublicKeyToken=b28c218413bdf563
FusionLog : WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
 
Data : System.Collections.ListDictionaryInternal
TargetSite : Void rlvBlogPosts_ItemDataBound(System.Object, Telerik.Web.UI.RadListViewItemEventArgs)
Stack Trace :    at SitefinityWebApp.StopTechControls.Templates.Blog.BlogList.rlvBlogPosts_ItemDataBound(Object sender, RadListViewItemEventArgs e)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at Telerik.Web.UI.RadListView.BuildDataItem(Int32 itemsCreatedCount, Control itemContainer, Boolean dataBinding, Object dataItem, Int32& controlIndex)
   at Telerik.Web.UI.RadListView.CreateDataItems(Control container, IEnumerable dataSource, Boolean dataBinding)
   at Telerik.Web.UI.RadListView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding)
   at Telerik.Web.UI.RadListView.PerformDataBinding(IEnumerable data)
   at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data)
   at Telerik.Web.UI.RadListView.PerformSelect()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.AddedControl(Control control, Int32 index)
   at Telerik.Sitefinity.Web.UI.ContentUI.Views.Backend.ViewBase.CreateChildControls()
 
Additional Info:
 
MachineName : StopTechWeb1
TimeStamp : 11/20/2011 9:50:45 PM
FullName : Telerik.Sitefinity.Utilities, Version=4.3.1885.0, Culture=neutral, PublicKeyToken=b28c218413bdf563
AppDomainName : /LM/W3SVC/2/ROOT-2-129662993862118000

Markup:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="BlogList.ascx.cs" Inherits="SitefinityWebApp.StopTechControls.Templates.Blog.BlogList" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit" Assembly="Telerik.Sitefinity" %>
<div id="bloghomepost">
    <telerik:RadListView ID="Repeater" ItemPlaceholderID="ItemsContainer" runat="server"
        EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false" OnItemDataBound="rlvBlogPosts_ItemDataBound">
        <LayoutTemplate>
            <sf:ContentBrowseAndEditToolbar ID="MainBrowseAndEditToolbar" runat="server" Mode="Add">
            </sf:ContentBrowseAndEditToolbar>
            <asp:PlaceHolder ID="ItemsContainer" runat="server" />
        </LayoutTemplate>
        <ItemTemplate>
            <div runat="server" id="dvPost">
                <div id="leftdate">
                    <div class="datebox">
                        <p class="day">
                            <asp:Literal runat="server" ID="lblDay"></asp:Literal></p>
                        <p class="month">
                            <asp:Literal runat="server" ID="lblMonth"></asp:Literal></p>
                    </div>
                </div>
                <div class="centerblogpost">
                    <h2>
                        <sf:DetailsViewHyperLink ID="DetailsViewHyperLink1" TextDataField="Title" ToolTipDataField="Description"
                            runat="server" /></h2>
                    <asp:Image runat="server" ID="imgPost" Width="170px" />
                </div>
                <div class="rightblogpost">
                    <p class="postinfo">
                        posted by:
                        <asp:Literal runat="server" ID="lblAuthor"></asp:Literal>  
                        <%--<asp:Literal runat="server" ID="lblCommentCount"></asp:Literal>--%>   
                        <%--<img src="images/bloglink.png" alt="blog link" />
                                <a href="#" target="_self">Share this</a>--%></p>
                    <p class="postdesc">
                        <asp:Literal runat="server" ID="lblSummary"></asp:Literal></p>
                    <p class="postinfo">
                        <sf:DetailsViewHyperLink ID="DetailsViewHyperLink2" Text="Read More" ToolTipDataField="Description"
                            runat="server" />
                    </p>
                </div>
                <div class="clear">
                </div>
            </div>
        </ItemTemplate>
    </telerik:RadListView>
    <sf:Pager ID="pager" runat="server" ShowPrevAndNext="True" CssClass="pager" >
    </sf:Pager>
</div>

The code file looks like this:
protected void rlvBlogPosts_ItemDataBound(object sender, RadListViewItemEventArgs e)
       
           var dataItem = ((RadListViewDataItem)e.Item).DataItem;
           var post = (BlogPost)dataItem;
 
           var day = e.Item.FindControl("lblDay") as Literal;
           var month = e.Item.FindControl("lblMonth") as Literal;
           //var title = e.Item.FindControl("lblTitle") as Literal;
           var desc = e.Item.FindControl("lblSummary") as Literal;
           var author = e.Item.FindControl("lblAuthor") as Literal;
           //var comments = e.Item.FindControl("lblCommentCount") as Literal;
           var image = e.Item.FindControl("imgPost") as Image;
           var link1 = e.Item.FindControl("lnkTitle") as HyperLink;
           var link2 = e.Item.FindControl("lnkReadMore") as HyperLink;
           var div = e.Item.FindControl("dvPost") as HtmlGenericControl;
 
           day.Text = post.PublicationDate.Day.ToString();
           month.Text = post.PublicationDate.ToString("MMM");
           //title.Text = post.Title;
 
           var content = HtmlRemoval.StripTagsCharArray(post.Content);
           desc.Text = content.Length > 400 ? content.Substring(0, 330) + "..." : content;
 
           author.Text = GlobalMembers.GetUserFullName(post.Owner);
 
           //var count = post.Comments.Count;
           //comments.Text = count.ToString() + " " + (count == 1 ? "comment" : "comments");
 
           var imageUrl = GlobalMembers.FetchLinksFromSource(post.Content).FirstOrDefault();
           if (imageUrl != null)
               image.ImageUrl = imageUrl.ToString();
 
           var target = GlobalMembers.GetTargetBlogPage();
           if (link1 != null && target != null) link1.NavigateUrl = DataResolver.Resolve(post, "URL", null, target.Id.ToString());
           if (link2 != null && target != null) link2.NavigateUrl = DataResolver.Resolve(post, "URL", null, target.Id.ToString());
 
           if (e.Item.ItemType == RadListViewItemType.AlternatingItem)
               div.Attributes.Add("class", "greypost");
           else
               div.Attributes.Add("class", "whitepost");
       

I realize most of that could be done in the markup, but this is more of a concept test for a bigger widget implementation later.  Either way, I need to start working again.  Thanks.

-Amir

Posted by Community Admin on 21-Nov-2011 00:00

Well the thing is, if this exists in your web app then it shouldn't be the template having version conflict errors.  I don't see anywhere where there's a version # specified.

DO you have an external assembly in there or a marketplace component which would be referencing the old assembly versions?

Posted by Community Admin on 21-Nov-2011 00:00

Steve... Thanks for the reply... I do have additional projects in the solution that use that assembly.  However, the reference is set to the main web application /bin directory, and in the properties window, it shows the correct version number.  However, based on your theory, I went ahead and removed the existing references and pointed them back to the same ones, and voila...all is great again.

Not sure why the new DLLs didn't update, as this has never been a problem in previous upgrades.

Anyway, thanks for the suggestion.... It led me to the true problem.  Thanks.

Posted by Community Admin on 21-Nov-2011 00:00

Hey Amir :)
  Yeah it's a pretty common problem (version conflicts)...99% of the time it's just an old reference, and the last 1% are the problems that make you want to throw your monitor out the window :)

When I have external components I always turn on Assembly Binding...adds a couple seconds to an upgrade, but saves a TON of headaches :)

Steve

This thread is closed