Telerik.WinControls.ThemeResolutionService threw an exception

10 posts, 1 answers
  1. Karl
    Karl avatar
    172 posts
    Member since:
    Sep 2010

    Posted 23 Jul 2012 Link to this post

    Hi All,

    I have a strange issue which I'm hoping someone knows how to fix...

    I have a winforms custom control that uses the RadScheduler and RadCalender controls. I originally had a couple of the Office 2010 themes added to the project and these have been removed as the built in colors work just fine. As far as I can see I have removed all references to these themes.
    My project copies the Telerik DLLs locally as the clients will not have the Telerik controls instaleld on them.

    However, I have built my control in release mode in VS 2010 and copied all the files to a test client machine, and when my control comes to load, I get the following error, and the the application closes:

    "The type initializer for 'Telerik.Controls.ThemeResolutionService' threw an exception"

    I am doing a tiny bit of custom coloring on the calendar control, but nothing involving styles or themes. Only when I reset the control do I do anything that might call this. This section of code is shown below...

    Can anyone tell me how I get around this, or have any suggestions as to what I could do to try to fix it? I've already searched for why this could be happening, but can't seem to find anything I haven't already tried.
    private void Calendar_ElementRender(object sender, RenderElementEventArgs e)
    {
        if (Calendar.SpecialDays.Contains(e.Day, new MyComparer()))
        {
            e.Element.NumberOfColors = 1;
            e.Element.BackColor = Color.Orange;
            e.Element.BorderColor = Color.DarkBlue;
        }
        else
        {
            e.Element.ResetValue(LightVisualElement.NumberOfColorsProperty, ValueResetFlags.Local);
            e.Element.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
            e.Element.ResetValue(LightVisualElement.BorderColorProperty, ValueResetFlags.Local);
        }
    }

    Thanks,
    Karl

  2. Karl
    Karl avatar
    172 posts
    Member since:
    Sep 2010

    Posted 23 Jul 2012 Link to this post

    A couple more points you might need to know.

    The references in my project are    
        Telerik.WinControls
        Telerik.Wincontrols.UI
        Telerik.WinControls.Scheduler

    We were testing this on a local client that also had the Telerik Winforms Controls installed. This machine was not giving us the error. We have since removed/uninstalled the Telerik Winforms Controls and now the machine is giving us the error.

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Answer
    Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 26 Jul 2012 Link to this post

    Hello Karl,

    Thank you for writing.

    First, I would like to mention that you should not deploy under any circumstances our assemblies on your client machines (since this is against our License Agreement), unless our assemblies are ILMerged with your application or you have build them as described here: http://www.telerik.com/help/winforms/installation-deployment-and-distribution-redestributing-telerik-radcontrols-for-windows.html.

    I do not think that code provided should not cause such an exception and I am unable what might do that. My only guess is that the Telerik.WinControls assembly is not on the target machine. If this is not the case, could you please get back to me with your project and the exacts steps that I need to follow in order to reproduce the exception. Once I do that I will investigate the reasons causing it and I will provide you with a solution.

    I am converting this Forum thread into a Support ticket in order to allow attachments.

    I am looking forward to your reply.
     
    Regards,
    Stefan
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  5. Karl
    Karl avatar
    172 posts
    Member since:
    Sep 2010

    Posted 27 Jul 2012 Link to this post

    Thanks for your reply. I'll give it a read.

    I am assuming that this method of deployment works for custom controls as well as executable applications? Our solution is for a custom control for use in Microsoft Navision Role Tailored Client.

    Karl

  6. Karl
    Karl avatar
    172 posts
    Member since:
    Sep 2010

    Posted 27 Jul 2012 Link to this post

    I've just read through the article you linked which talks of a VS2010 solution that I should have access to as part of my install. Unfortunately I can't seem to find this in my installation folder, or in my DevCraft Complete folder in my profile pages on the Telerik site.

    Could you explain to me how I get this solution so I can compile my own versions of the DLLs?

    Karl



  7. Karl
    Karl avatar
    172 posts
    Member since:
    Sep 2010

    Posted 29 Jul 2012 Link to this post

    Nevermind... I found the source download.

    Thanks.
  8. Karl
    Karl avatar
    172 posts
    Member since:
    Sep 2010

    Posted 30 Jul 2012 Link to this post

    I have been playing with this over the weekend and have had some success, but do have an issue I need help with.
    I followed the process where I compile the source after setting OEM flag and giving the executable name in the RadControl.cs file.

    After I did this, I referenced the DLLs I'd just compiled (only the ones I needed - Telerik.WinControls.dll, Telerik.WinControls.Ui.dll and TelerikCommon.dll) and added these as controls to my Visual Studio toolbar.

    When I added a simple control (RadPanel) to my form, it behaved very stangely, in that I couldnt select or move it etc.

    I had to reference the development DLL's, and then when I deployed to a test machine, instead of copying the development DLL's that the application required, I copied the ones I'd compiled from the Telerik source code and it seemed to work ok

    Is this the correct method to develop and deploy the DLL's or did I do something wrong?


  9. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 01 Aug 2012 Link to this post

    Hello Karl,

    Yes, this is the correct way to do that - install our controls on a machine and develop your application. Once you want to deploy it, use the assemblies that you built as described in the article.

    I hope this helps.

    Greetings,
    Stefan
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  10. Rawad
    Rawad avatar
    23 posts
    Member since:
    Jan 2012

    Posted 04 Dec 2012 Link to this post

    Hello

    I have a big issue.

    I have windows telerik components in my solution, the "Program.exe"  ( the desktop application), is running well on the computer where I  installed telerik components and visual studio,  but when I take this "Program.exe" and run it on in another machine, I'm getting: 

    "An error occurred creating the form. See Exception.InnerException for details.  The error is: The type initializer for 'Telerik.WinControls.ThemeResolutionService' threw an exception. "


    Knowing that I have   the 2 DLL  in the same folder when the "Program.exe" is running
    1-Telerik.WinControls.UI.dll
    2-Telerik.WinControls.dll


    Thanks advance for any help
  11. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 07 Dec 2012 Link to this post

    Hi Karl,

    Thank you for writing.

    It seems that your deployed application is missing an assembly that it needs. Please make sure that you follow exactly the steps from the article provided earlier: http://www.telerik.com/help/winforms/installation-deployment-and-distribution-redestributing-telerik-radcontrols-for-windows.html.

    If you continue experiencing issues, please get back to me with your project (or a sample one) and the exact steps that you are taking in order to reproduce the issue. This will allow us to investigate it and provide you with adequate support.

    Kind regards,
    Stefan
    the Telerik team
    Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
Back to Top
UI for WinForms is Visual Studio 2017 Ready