This is a migrated thread and some comments may be shown as answers.

Dependency Injection (StructureMap)

4 Answers 77 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Axe
Top achievements
Rank 1
Axe asked on 16 Feb 2010, 02:49 AM
I have an existing MVC 1 project where I'm using StructureMap and was getting errors when combining styles on the StyleSheetRegistrar. I'm guessing it has to do with over ridding the DefaultControllerFactory. it only happens when I add combine or compress. I created a standard MVC project and everythings works as expected.
Have you run into any problems with this or have any ideas?
The ScriptRegistrar seems to work fine.
Stack Trace:

[ArgumentNullException: Value cannot be null.
Parameter name: virtualPath]
   System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options) +8855735
   System.Web.VirtualPathUtility.Combine(String basePath, String relativePath) +30
   Telerik.Web.Mvc.Infrastructure.Implementation.VirtualPathProviderWrapper.CombinePaths(String basePath, String relativePath) +19
   Telerik.Web.Mvc.<>c__DisplayClass12.<ReplaceImagePath>b__11(Match match) +139
   System.Text.RegularExpressions.RegexReplacement.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat) +234
   System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator, Int32 count, Int32 startat) +28
   System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator) +38
   Telerik.Web.Mvc.WebAssetRegistry.ReplaceImagePath(String baseDiretory, String version, String content) +105
   Telerik.Web.Mvc.WebAssetRegistry.EnsureAsset(MergedAsset asset, String id) +559
   Telerik.Web.Mvc.WebAssetRegistry.Store(String contentType, WebAssetItemGroup assetGroup) +86
   Telerik.Web.Mvc.UI.<>c__DisplayClass3.<Merge>b__1(WebAssetItemGroup group) +68
   Telerik.Web.Mvc.UI.WebAssetItemMerger.Merge(String contentType, String assetHandlerPath, Boolean isSecured, Boolean canCompress, WebAssetItemCollection assets) +706
   Telerik.Web.Mvc.UI.<>c__DisplayClass3.<Write>b__2(WebAssetItemCollection assets) +40
   Telerik.Web.Mvc.UI.StyleSheetRegistrar.Write(TextWriter writer) +246
   Telerik.Web.Mvc.UI.StyleSheetRegistrar.Render() +81
   Telerik.Web.Mvc.UI.StyleSheetRegistrarBuilder.Render() +12
   ASP.views_shared_main_master.__Render__control2(HtmlTextWriter __w, Control parameterContainer) in d:\Documents\Visual Studio 2008\Projects\AESFA New Design\Zigzag.AESFA.MVC\Views\Shared\main.Master:10
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.HtmlControls.HtmlHead.RenderChildren(HtmlTextWriter writer) +17
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   ASP.views_shared_main_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\e02683e2\807c6452\App_Web_7lzjbw-m.7.cs:0
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   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) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) +59
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266

4 Answers, 1 is accepted

Sort by
0
Accepted
Kazi Manzur Rashid
Telerik team
answered on 16 Feb 2010, 04:44 AM
Hello Axe,

Could you please post the stylesheet files that you are using, it looks like css image path issue rather than StructureMap.

Best wishes,
Kazi Manzur Rashid
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Axe
Top achievements
Rank 1
answered on 16 Feb 2010, 05:44 AM
This works:

 

    <%   
        Html.Telerik().StyleSheetRegistrar()  
            .DefaultGroup(dg =>  
                dg  
                .Add("telerik.common.css")  
                .Add("telerik.black.css")  
                .Add("~/content/css/style.css")  
                .Add("~/content/css/tabs-no-images.css")  
                .Add("~/content/css/table.css")  
                )  
                .Render();   
    %>  
 
This does not:
    <%   
        Html.Telerik().StyleSheetRegistrar()  
            .DefaultGroup(dg =>  
                dg  
                .Add("telerik.common.css")  
                .Add("telerik.black.css")  
                .Add("~/content/css/style.css")  
                .Add("~/content/css/tabs-no-images.css")  
                .Add("~/content/css/table.css")  
                .Combined(true)  
                )  
                .Render();   
    %>  
 
0
Axe
Top achievements
Rank 1
answered on 16 Feb 2010, 05:52 AM
Did you want to see the actual style sheets?

That question triggered me to try removing the style sheets one at a time and it seems the file style.css causes it.
I never would have thought.
If that's the case I will go through the style sheet to see what's going on

Regards
0
Axe
Top achievements
Rank 1
answered on 16 Feb 2010, 05:55 AM
I found it. There was an empty reference to a background image.

Thanks
Tags
General Discussions
Asked by
Axe
Top achievements
Rank 1
Answers by
Kazi Manzur Rashid
Telerik team
Axe
Top achievements
Rank 1
Share this question
or