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

Exception when using .Combined(true)

2 Answers 82 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.
Danan
Top achievements
Rank 1
Danan asked on 28 Jan 2011, 05:24 PM
I am recieving the following exception when using .Combined(true) on both the stylesheet and script registrar:
[ArgumentNullException: Value cannot be null.
Parameter name: stream]
   System.IO.Compression.DeflateStream..ctor(Stream stream, CompressionMode mode, Boolean leaveOpen) +6095539
   System.IO.Compression.GZipStream..ctor(Stream stream, CompressionMode mode, Boolean leaveOpen) +45
   System.IO.Compression.GZipStream..ctor(Stream stream, CompressionMode mode) +10
   Telerik.Web.Mvc.Infrastructure.Implementation.HttpResponseCompressor.Compress(HttpContextBase context) +188
   Telerik.Web.Mvc.WebAssetHttpHandler.ProcessRequest(HttpContextBase context) +428
   Telerik.Web.Mvc.Infrastructure.HttpHandlerBase.ProcessRequest(HttpContext context) +63
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Anyone else having this issue or know how to resolve this?  Here is my usage:
@Html.Telerik().ScriptRegistrar().Scripts(scripts =>
        scripts.AddGroup("Jquery", group => 
            group.Add("~/Scripts/jquery-1.4.4.js")
                 .Add("~/Scripts/jquery-ui.js")
                 .Add("~/Scripts/jquery.validate.js")
                 .Add("~/Scripts/jquery.unobtrusive-ajax.js").Combined(true)))

The code works fine when I remove .Combined(true).  This is the version I am using: 2010.3.1318

2 Answers, 1 is accepted

Sort by
0
Accepted
T. Tsonev
Telerik team
answered on 31 Jan 2011, 09:59 AM
Hi Danan,

I've tried the script registrar configuration you've sent, but it appears to work fine in my project. Please see the attached file.

I've removed the reference to jQuery as it's already registered, but it was working even before I did so.

Can you please try to modify the project so it reproduces the error?

Regards,
Tsvetomir Tsonev
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
Danan
Top achievements
Rank 1
answered on 31 Jan 2011, 03:59 PM
I have located the source of the error.  When you override the response output with a text writer you will receive this error.  Currently we override the output so we can translate terminology keys.  Looks like we are going to have to implement a solution that uses response filter so we don't override the output so we can use .combine and .compress.

protected void Application_BeginRequest()
{
    Response.Output = new TerminologyWriter(Response.Output, DependencyResolver.Current.GetService<ITerminologyValueProvider>());
}

TerminologyWriter : TextWriter

Thanks for taking the time to look into this issue.
Tags
General Discussions
Asked by
Danan
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Danan
Top achievements
Rank 1
Share this question
or