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

NullReferenceException when Telerik.Web.UI.dll in GAC

6 Answers 253 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vladimir
Top achievements
Rank 1
Vladimir asked on 07 Aug 2012, 12:02 PM
Hello, help me please.

I use Telerik asp.net AJAX in my ASP.NET  application (version 2012.2.724.35)
I get an error "NullReferenceException" (when the page loads containing Telerik controls) when putting the assembly Telerik.Web.UI.dll in GAC  o_O...
When the assembly is not in GAC - everything is working fine.

What am I doing wrong?

6 Answers, 1 is accepted

Sort by
0
Ivana
Telerik team
answered on 09 Aug 2012, 10:34 AM
Hi Vladimir,

The following article has some information on how to add assemblies to the GAC: http://www.telerik.com/support/kb/aspnet-ajax/general/adding-a-control-to-the-gac-global-assembly-cache.aspx.

Could you please paste here the registration of the Telerik.Web.UI assemblies on your page and in your web.config file?

Kind regards,
Ivana
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Vladimir
Top achievements
Rank 1
answered on 09 Aug 2012, 11:23 AM
Thanks for the article. I did an assembly installed in a similar way.

registration assemblies on page
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>


I tried to use
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2012.2.724.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>
but it did not help

registration assemblies on web.config file

<configuration>
  <configSections>
  ...
  </configSections>
  <appSettings>
    <add key="Telerik.EnableEmbeddedSkins" value="true"/>
    ...
    <add key="Telerik.Skin" value="Vista"/>
  </appSettings>
  ...
  <system.web>
...
    <compilation debug="true">
      <assemblies>
...
        <add assembly="Telerik.Web.UI, Version=2012.2.724.35, Culture=neutral, PublicKeyToken=121FAE78165BA3D4"/>        
      </assemblies>
    </compilation>
    ...
    ...
     <pages>
      <controls>
        ...
        <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI, Version=2012.2.724.35, Culture=neutral, PublicKeyToken=121FAE78165BA3D4"/>
      </controls>
    </pages>
    ...
    <httpHandlers>
      ...
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" 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"/>
    </httpHandlers>
  </system.web>

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
      <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"/>
    </modules>
    <handlers>
      <remove name="WebServiceHandlerFactory-Integrated"/>
      <remove name="ScriptHandlerFactory"/>
      <remove name="ScriptHandlerFactoryAppServices"/>
      <remove name="ScriptResource"/>
      <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=3.5.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=3.5.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=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/>
      <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/>
      <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/>
      <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/>
      <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/>
    </handlers>
  </system.webServer>
  <runtime>
    <assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  ...
</configuration>



Ivana, your name is Ivan? Do you speak Russian?
0
Ivana
Telerik team
answered on 14 Aug 2012, 10:11 AM
Hello Vladimir,

Could you confirm that the PublicKeyToken is the the same in your web.config file and in the GAC?
You could use the following commands in Visual Studio Command Prompt in order to get enlisted all the content in the GAC into a external .txt file:
gacutil /l > c:/text.txt -- creates a txt file containing all the references from the GAC in the file specifies by the path.

I hope this will help.

All the best,
Ivana
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Wasife
Top achievements
Rank 1
answered on 12 Nov 2012, 07:50 AM
Any update on this as I am having exactly the same issue. The public key token and all other information in my web.config are correct. Thanks in advance for your help.
0
Plamen
Telerik team
answered on 13 Nov 2012, 11:11 AM
Hi,

 Would you please provide some more information about the exact error message observed and the web config settings used so we can inspect them and be more helpful? 

Kind regards,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Wasife
Top achievements
Rank 1
answered on 13 Nov 2012, 12:47 PM
I was able to fix that by giving the full name of the assembly in the Assembly attribute of <asp:ScriptReference> element in the RadScriptManager in my master page. Anyways- thanks for replying.

Cheers,
Wasif.
Tags
General Discussions
Asked by
Vladimir
Top achievements
Rank 1
Answers by
Ivana
Telerik team
Vladimir
Top achievements
Rank 1
Wasife
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or