I recently upgraded our web project to Telerik version 2011.2.712 (Mvc 2, .NET 3.5). Previously we were using 2010.2.929 for Telerik.Web.UI.dll and 2010.3.1318 for Telerik.Web.Mvc.dll.
After the upgrade, images stopped loading correctly. After debugging the issue, I found that Telerik.Web.UI.RadCompression is throwing a NullReferenceException:
Message
Object reference not set to an instance of an object.
Stack Trace
at System.Object.GetType()
at Telerik.Web.UI.RadCompression.Compress(HttpApplication application)
at Telerik.Web.UI.RadCompression.PreRequestHandlerExecute(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
<
httpModules
>
<
add
name
=
"ScriptModule"
type
=
"System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
name
=
"UrlRoutingModule"
type
=
"System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
name
=
"RadUploadModule"
type
=
"Telerik.Web.UI.RadUploadHttpModule"
/>
<!--<add name="RadCompression" type="Telerik.Web.UI.RadCompression" />-->
</
httpModules
>
<
modules
runAllManagedModulesForAllRequests
=
"true"
>
<
remove
name
=
"UrlRoutingModule"
/>
<
remove
name
=
"ScriptModule"
/>
<
add
name
=
"ScriptModule"
preCondition
=
"managedHandler"
type
=
"System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
name
=
"UrlRoutingModule"
preCondition
=
""
type
=
"System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
remove
name
=
"RadUploadModule"
/>
<
add
name
=
"RadUploadModule"
type
=
"Telerik.Web.UI.RadUploadHttpModule"
preCondition
=
"integratedMode"
/>
<!--<remove name="RadCompression" />-->
<!--<add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode" />-->
<
remove
name
=
"HttpPreprocessModule"
/>
<
add
name
=
"HttpPreprocessModule"
type
=
"Microsoft.Cosmos.FrontEnd.WebService.IISHost.HttpPreprocessModule, Microsoft.Cosmos.FrontEnd.IISServiceHost"
/>
</
modules
>
Is this a know issue with the latest release?
Thanks,
Alex
18 Answers, 1 is accepted

Could someone from Telerik please confirm whether this is an issue with the release or a bug on our end?
Thanks,
Alex
We have not received reports for similar issues so far. Would you mind providing us with some more details about the server version your application runs on as well as the steps we need to take in order to replicate the issue? This way I will be able to debug it locally and provide you with more to the point resolution.
Meanwhile, could you please try removing the preCondition attribute from your RadCompression declaration and let me know whether the issue still exists?
Regards,
Martin
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

<
modules
runAllManagedModulesForAllRequests
=
"true"
>
<
remove
name
=
"RadUploadModule"
/>
<
remove
name
=
"RadCompression"
/>
<
add
name
=
"RadUploadModule"
type
=
"Telerik.Web.UI.RadUploadHttpModule"
preCondition
=
"integratedMode"
/>
<!--<add name="RadCompression" type="Telerik.Web.UI.RadCompression" />-->
</
modules
>
Since a second customer encounters this problem it seems that there is a problem with the RadCompression module in this scenario. The best approach we can follow in resolving the issue is to send me a runnable sample that I can debug locally. In addition I would need the IIS version you are hosting on and the application pool settings you use. This way I will be able to track the cause of the problem and provide you with more to the point resolution.
Just for testing purposes, could you please try whether removing the "runAllManagedModulesForAllRequests" attribute and setting precondition="managedHandler" for the RadCompression module changes the behavior:
<
modules
>
<
remove
name
=
"RadUploadModule"
/>
<
remove
name
=
"RadCompression"
/>
<
add
name
=
"RadUploadModule"
type
=
"Telerik.Web.UI.RadUploadHttpModule"
preCondition
=
"integratedMode"
/>
<
add
name
=
"RadCompression"
type
=
"Telerik.Web.UI.RadCompression"
precondition
=
"managedHandler"
/>
</
modules
>
Best wishes,
Martin
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

IIS 7.5
Telerik 2011.2.712
.Net 4
Managed pipeline mode: Integrated
Broken:
<
modules
runAllManagedModulesForAllRequests
=
"true"
>
<
add
name
=
"RadCompression"
type
=
"Telerik.Web.UI.RadCompression"
/>
</
modules
>
Working:
<
modules
>
<
add
name
=
"RadCompression"
type
=
"Telerik.Web.UI.RadCompression"
preCondition
=
"managedHandler"
/>
</
modules
>

IIS 7.0
Telerik 2011.2.712
.Net 4
Managed pipeline mode: Integrated
Here is the error report:
2011/08/10 05:38:15 System.NullReferenceException: Object reference not set to an instance of an object. at Telerik.Web.UI.RadCompression.Compress(HttpApplication application) at Telerik.Web.UI.RadCompression.PreRequestHandlerExecute(Object sender, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
And below is the Web.config for the application:
<?
xml
version
=
"1.0"
?>
<
configuration
>
<
appSettings
>
<
add
key
=
"Telerik.Web.UI.DialogParametersEncryptionKey"
value
=
"cElPYlhVajgzR3JiZERHdXdpd0JRNFVCTWVBPUx0NkU1"
/>
</
appSettings
>
<
system.web
>
<
compilation
debug
=
"false"
targetFramework
=
"4.0"
>
<
assemblies
>
<
add
assembly
=
"System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"
/>
<
add
assembly
=
"System.Configuration.Install, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"
/>
<
add
assembly
=
"System.Data.OracleClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
/>
<
add
assembly
=
"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
/>
<
add
assembly
=
"System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"
/>
<
add
assembly
=
"System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
assembly
=
"Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"
/>
<
add
assembly
=
"System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
/>
<
add
assembly
=
"System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
/>
<
add
assembly
=
"System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
/>
</
assemblies
>
</
compilation
>
<
authentication
mode
=
"Windows"
/>
<
pages
viewStateEncryptionMode
=
"Never"
validateRequest
=
"false"
enableEventValidation
=
"false"
enableSessionState
=
"true"
enableViewStateMac
=
"false"
controlRenderingCompatibilityVersion
=
"3.5"
clientIDMode
=
"AutoID"
>
<
controls
>
<
add
tagPrefix
=
"telerik"
namespace
=
"Telerik.Web.UI"
assembly
=
"Telerik.Web.UI"
/>
<
add
tagPrefix
=
"asp"
namespace
=
"System.Web.UI"
assembly
=
"System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
tagPrefix
=
"asp"
namespace
=
"System.Web.UI.WebControls"
assembly
=
"System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
</
controls
>
</
pages
>
<
httpHandlers
>
<
remove
verb
=
"*"
path
=
"*.asmx"
/>
<
add
verb
=
"*"
path
=
"*.asmx"
validate
=
"false"
type
=
"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
verb
=
"*"
path
=
"*_AppService.axd"
validate
=
"false"
type
=
"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
verb
=
"GET,HEAD"
path
=
"ScriptResource.axd"
type
=
"System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
validate
=
"false"
/>
<
add
path
=
"ChartImage.axd"
type
=
"Telerik.Web.UI.ChartHttpHandler"
verb
=
"*"
validate
=
"false"
/>
<
add
path
=
"Telerik.Web.UI.SpellCheckHandler.axd"
type
=
"Telerik.Web.UI.SpellCheckHandler"
verb
=
"*"
validate
=
"false"
/>
<
add
path
=
"Telerik.Web.UI.DialogHandler.aspx"
type
=
"Telerik.Web.UI.DialogHandler"
verb
=
"*"
validate
=
"false"
/>
<
add
path
=
"Telerik.RadUploadProgressHandler.ashx"
type
=
"Telerik.Web.UI.RadUploadProgressHandler"
verb
=
"*"
validate
=
"false"
/>
<
add
path
=
"Telerik.Web.UI.WebResource.axd"
type
=
"Telerik.Web.UI.WebResource"
verb
=
"*"
validate
=
"false"
/>
</
httpHandlers
>
<
httpModules
>
<
add
name
=
"ScriptModule"
type
=
"System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
</
httpModules
>
<
httpRuntime
requestValidationMode
=
"2.0"
/>
</
system.web
>
<
system.webServer
>
<
handlers
>
<
remove
name
=
"ScriptHandlerFactory"
/>
<
remove
name
=
"ScriptHandlerFactoryAppServices"
/>
<
remove
name
=
"ScriptResource"
/>
<
remove
name
=
"WebServiceHandlerFactory-Integrated"
/>
<
remove
name
=
"ChartImage_axd"
/>
<
remove
name
=
"Telerik_Web_UI_SpellCheckHandler_axd"
/>
<
remove
name
=
"Telerik_Web_UI_DialogHandler_aspx"
/>
<
remove
name
=
"Telerik_RadUploadProgressHandler_ashx"
/>
<
remove
name
=
"Telerik_Web_UI_WebResource_axd"
/>
<
add
name
=
"ScriptHandlerFactory"
verb
=
"*"
path
=
"*.asmx"
preCondition
=
"integratedMode"
type
=
"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
name
=
"ScriptHandlerFactoryAppServices"
verb
=
"*"
path
=
"*_AppService.axd"
preCondition
=
"integratedMode"
type
=
"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
name
=
"ScriptResource"
preCondition
=
"integratedMode"
verb
=
"GET,HEAD"
path
=
"ScriptResource.axd"
type
=
"System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
name
=
"*.vbhtml_*"
path
=
"*.vbhtml"
verb
=
"*"
type
=
"System.Web.HttpForbiddenHandler"
preCondition
=
"integratedMode,runtimeVersionv4.0"
/>
<
add
name
=
"*.vbhtm_*"
path
=
"*.vbhtm"
verb
=
"*"
type
=
"System.Web.HttpForbiddenHandler"
preCondition
=
"integratedMode,runtimeVersionv4.0"
/>
<
add
name
=
"*.cshtml_*"
path
=
"*.cshtml"
verb
=
"*"
type
=
"System.Web.HttpForbiddenHandler"
preCondition
=
"integratedMode,runtimeVersionv4.0"
/>
<
add
name
=
"*.cshtm_*"
path
=
"*.cshtm"
verb
=
"*"
type
=
"System.Web.HttpForbiddenHandler"
preCondition
=
"integratedMode,runtimeVersionv4.0"
/>
<
add
name
=
"*.aspq_*"
path
=
"*.aspq"
verb
=
"*"
type
=
"System.Web.HttpForbiddenHandler"
preCondition
=
"integratedMode,runtimeVersionv4.0"
/>
<
add
name
=
"*.xamlx_*"
path
=
"*.xamlx"
verb
=
"*"
type
=
"System.Xaml.Hosting.XamlHttpHandlerFactory, System.Xaml.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
preCondition
=
"integratedMode,runtimeVersionv2.0"
/>
<
add
name
=
"*.xoml_*"
path
=
"*.xoml"
verb
=
"*"
type
=
"System.ServiceModel.Activation.HttpHandler, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
preCondition
=
"integratedMode,runtimeVersionv2.0"
/>
<
add
name
=
"*.svc_*"
path
=
"*.svc"
verb
=
"*"
type
=
"System.ServiceModel.Activation.HttpHandler, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
preCondition
=
"integratedMode,runtimeVersionv2.0"
/>
<
add
name
=
"*.soap_*"
path
=
"*.soap"
verb
=
"*"
type
=
"System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
preCondition
=
"integratedMode,runtimeVersionv2.0"
/>
<
add
name
=
"*.rem_*"
path
=
"*.rem"
verb
=
"*"
type
=
"System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
preCondition
=
"integratedMode,runtimeVersionv2.0"
/>
<
add
name
=
"*.asmx_*"
path
=
"*.asmx"
verb
=
"*"
type
=
"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
preCondition
=
"integratedMode,runtimeVersionv2.0"
/>
<
add
name
=
"ScriptResource.axd_GET,HEAD"
path
=
"ScriptResource.axd"
verb
=
"GET,HEAD"
type
=
"System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
preCondition
=
"integratedMode,runtimeVersionv2.0"
/>
<
add
name
=
"*_AppService.axd_*"
path
=
"*_AppService.axd"
verb
=
"*"
type
=
"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
preCondition
=
"integratedMode,runtimeVersionv2.0"
/>
<
add
name
=
"eurl.axd_*"
path
=
"eurl.axd"
verb
=
"*"
type
=
"System.Web.HttpNotFoundHandler"
preCondition
=
"integratedMode,runtimeVersionv2.0"
/>
<
add
name
=
"Telerik_Web_UI_WebResource_axd"
path
=
"Telerik.Web.UI.WebResource.axd"
type
=
"Telerik.Web.UI.WebResource"
verb
=
"*"
preCondition
=
"integratedMode"
/>
<
add
name
=
"Telerik_RadUploadProgressHandler_ashx"
path
=
"Telerik.RadUploadProgressHandler.ashx"
type
=
"Telerik.Web.UI.RadUploadProgressHandler"
verb
=
"*"
preCondition
=
"integratedMode"
/>
<
add
name
=
"Telerik_Web_UI_DialogHandler_aspx"
path
=
"Telerik.Web.UI.DialogHandler.aspx"
type
=
"Telerik.Web.UI.DialogHandler"
verb
=
"*"
preCondition
=
"integratedMode"
/>
<
add
name
=
"Telerik_Web_UI_SpellCheckHandler_axd"
path
=
"Telerik.Web.UI.SpellCheckHandler.axd"
type
=
"Telerik.Web.UI.SpellCheckHandler"
verb
=
"*"
preCondition
=
"integratedMode"
/>
<
add
name
=
"ChartImage_axd"
path
=
"ChartImage.axd"
type
=
"Telerik.Web.UI.ChartHttpHandler"
verb
=
"*"
preCondition
=
"integratedMode"
/>
</
handlers
>
<
modules
runAllManagedModulesForAllRequests
=
"true"
>
<
remove
name
=
"ScriptModule"
/>
<
add
name
=
"ScriptModule"
preCondition
=
"managedHandler"
type
=
"System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
name
=
"RadUploadModule"
type
=
"Telerik.Web.UI.RadUploadHttpModule"
/>
<
add
name
=
"RadCompression"
type
=
"Telerik.Web.UI.RadCompression"
/>
</
modules
>
<
validation
validateIntegratedModeConfiguration
=
"false"
/>
</
system.webServer
>
<
system.codedom
>
<
compilers
>
<
compiler
language
=
"c#;cs;csharp"
extension
=
".cs"
type
=
"Microsoft.CSharp.CSharpCodeProvider, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
warningLevel
=
"4"
compilerOptions
=
"/doc:LawDepotEditor.xml"
>
<
providerOption
name
=
"CompilerVersion"
value
=
"v4.0"
/>
<
providerOption
name
=
"WarnAsError"
value
=
"false"
/>
</
compiler
>
</
compilers
>
</
system.codedom
>
</
configuration
>
I have reviewed your .config file and noticed the following line:
<
modules
runAllManagedModulesForAllRequests
=
"true"
>
As Aaron stated in a post previous to yours, removing the runAllManagedModulesForAllRequests="true" declaration in the modules section and adding preCondition="managedHandler" for the RadCompression module section worked for his case. Could you please confirm that for your scenario?
Here is how the modified code should look:
<
modules
>
<
remove
name
=
"ScriptModule"
/>
<
add
name
=
"ScriptModule"
preCondition
=
"managedHandler"
type
=
"System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
name
=
"RadUploadModule"
type
=
"Telerik.Web.UI.RadUploadHttpModule"
/>
<
add
name
=
"RadCompression"
type
=
"Telerik.Web.UI.RadCompression"
preCondition
=
"managedHandler"
/>
</
modules
>
Let me know whether the issue persists after you apply the modifications above.
Best wishes,
Martin
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

If I have another module that requires
<
modules
runAllManagedModulesForAllRequests
=
"true"
>
Is there another workaround available to still use RadCompression and avoid this error?
Thanks in advance!
There is no explicit need for setting runAllManagedModulesForAllRequests="true". This property is just a shortcut which applies for all modules (effectively ignoring any preCondition that might have been set). You can enable the same behavior for your other module by not applying a preCondition for it (simply remove its precondition attribute). This is explained in the following resource:
http://learn.iis.net/page.aspx/121/iis-7-modules-overview/#Precondition
Kind regards,
Pavel
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

IIS 7.5
Telerik 2011.2.712
.Net 4
Managed pipeline mode: Integrated

I have not been able to reproduce the error at all, but this has not come up in our error logs since making the change, so it appears to have worked.
Thanks,
Chris

Later versions of Firefox never cause the error, neither do other browsers.
I don't know if that sheds any light on the issue..?

I'm also getting the same error and stacktrace, but in 1 scenario, running IIS7.5 on Win 2008:
- http://www.applications.tst/ generates the error when i click on something and there is a page postback
- http://www.applications.tst/master.aspx generates no error...
the default doc is master.aspx, but the app is not working correctly if you do not type "master.aspx"...
When I do this on my dev machine, running local IIS7.5 on Win 7, there is no problem...
The behaviour on the server of my client is exactly the same, also a Win 2007 IIS7.5
browser does not matter (FF, Chrome. IE9)
telerik controls version = 2011.3.1305.40
Regards,
Erik
Try the solution provided at the bottom of this topic:
http://www.telerik.com/help/aspnet-ajax/radcompression.html (under the know issues section)
All the best,
Iana Tsolova
the Telerik team

I had to do both (change preCondition and disable runAllManagedModulesForAllRequests ) and that did the trick.
<
modules
runAllManagedModulesForAllRequests
=
"false"
>
<
remove
name
=
"RadCompression"
/>
<
add
name
=
"RadCompression"
type
=
"Telerik.Web.UI.RadCompression"
preCondition
=
"managedHandler"
/>
</
modules
>
Erik

"runtimeVersionv4.0" to "runtimeVersionv2.0"

I encountered this problem now.
Telerik 2012.3.1016.40
IIS 6.1 SP 1
Suggested fixes worked, but I would like to add what changed for us and since then we experienced this problem.
We enabled Dynamic Content Compression on IIS for the affected websites. Maybe this is what causes the problem. Unfortunately I am not in the position to test this myself, as I am not allowed to chancge this configuration for our our testservers.
With regards.
/Yeroon
First - I have not heard about IIS 6.1.
Second - it is clearly stated here that the problem is a Breaking change in ASP.NET 40 that causes the issue. In case you manage to isolate the issue in a project with dynamic compression enabled, please send it to us so that we can inspect it further.
I hope this helps.
Regards,
Martin
the Telerik team