Duplicate resource definition

Jan 13, 2011 at 2:41 PM

Hi,


I followed every instruction here for this to work with ASP MVC 2.0 My first run is ok but when I refresh the page I get this exception:

Exception Details: Xpedite.XpediteException: Duplicate resource definition 'MyCombinedJs'."

Here is the stacktrace:

[XpediteException: Duplicate resource definition 'MyCombinedJs'."]
   Xpedite.Mvc.Extensions.TempDataExtensions.StoreDefinition(HtmlHelper htmlHelper, IResourceDefinition definition) +381
   Xpedite.Mvc.Html.CompositeResourceExtensions.CompositeResource(HtmlHelper htmlHelper, IResourceDefinition definition, IEnumerable`1 resources, Boolean debugMode) +145
   Xpedite.Mvc.Html.CompositeResourceExtensions.CompositeResource(HtmlHelper htmlHelper, ResourceType resourceType, String referenceName, IEnumerable`1 resources) +576
   Xpedite.Mvc.Html.CompositeScriptResourceExtensions.CompositeScriptResource(HtmlHelper htmlHelper, String referenceName, IEnumerable`1 resources) +45
   ASP.views_account_register_aspx.__RenderContent1(HtmlTextWriter __w, Control parameterContainer) in c:\c:\Users\Geocine\Documents\WebMVC\WebMVC\Views\Account\Register.aspx:5
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +109
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   ASP.views_shared_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\Users\Geocine\Documents\WebMVC\WebMVC\Views\Shared\Site.Master:45
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +109
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) +56
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3060

Jan 15, 2011 at 3:34 AM
Edited Jan 15, 2011 at 3:35 AM

Hi again,

Unforunately, please ignore my  previous response (deleted as it was noise); I had another item on my mind when I had replied (unrelated to your issue documented above - should have waited until I landed rather than trying to reply before boarding my flight).

I spent a little time attempting to reproduce the error, and although I have a couple more ideas on what may be the cause, I was hoping you could please provide some insight on how your page(s) are configured.

1) Are your resources defined in the master, view or both?

2) Are your resources defined either directly in the HEAD or in a HEAD placeholder? or are they defined in the page body?

Any additional details you can provide on how the page is stuctured would be greatly appreciated. I will run through a couple more configurations to see if I can reproduce the issue above, but more information would be a great help.

Thanks,

Chris

Jan 15, 2011 at 2:04 PM

Hi,

I have a contentplaceholder on my master page. I placed the CompositeScriptResource on my view page.  as described by the error:

ASP.views_account_register_aspx.__RenderContent1(HtmlTextWriter __w, Control parameterContainer) in c:\c:\Users\Geocine\Documents\WebMVC\WebMVC\Views\Account\Register.aspx:5

ASP.views_shared_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\Users\Geocine\Documents\WebMVC\WebMVC\Views\Shared\Site.Master:45

Thanks,

Geocine

 

Jan 15, 2011 at 7:32 PM

Interesting... not sure how I have never encountered this before, but it has to do with how TempData is being used to temporarily store the definition state (required for CSS Sprites) for the page request. Will switch to use ViewData and run some tests; hopefully have an updated release posted by end of day today once I am happy with how everything is working.

Jan 15, 2011 at 9:43 PM

Version 1.0.1.0 release posted with required fix (fully stress tested).

Please let me know if you have any further issues.