Binding context error

5 posts, 0 answers
  1. Anthony Daniel
    Anthony Daniel avatar
    2 posts
    Member since:
    Jul 2008

    Posted 05 Feb 2009 Link to this post

    Our WinForms application loads some assemblies into the Load and LoadFrom contexts. Some RadButtons are used by assemblies in each group, so we also load Telerik.WinControls.dll into both contexts.  However when we do this, some machines receive an error when opening the main form.  It appears that a telerik library is popping the dialog with the following text:

    Visual Studio is attempting to load class instances from a different assembly than the original used to create your components.  This will result in failure to load your designed component.  More information that will help you to correct the problem.

    Component Assembly:
    D:\Documents and Settings\09006318\Local Settings\Application Data\Test App\Assemblies\Telerik.WinControls.dll

    Designer Assembly:
    C:\Program Files\Test App\Telerik.WinControls.dll

    Please Close Visual Studio, remove the errant assembly and try loading your designer again.

    Ensure that you do not attempt to save any designer that opens with errors, as this can result in loss of work.  Note that you may receive this message multiple times, once for each component instance in your designer.


    Of course Visual Studio is not installed on any of the machines with this problem.  If we only load the Telerik libraries into the Load context, the error disappears.  What is causing this error?

  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 09 Feb 2009 Link to this post

    Hello Anthony Daniel,

    Thank you for writing.

    From what I see you are loading the same assembly from different places. Load the assembly from the same place and tell us if the problem persists.

    I am looking forward to your reply.

    Kind regards,
    Victor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Yosief
    Yosief avatar
    26 posts
    Member since:
    Mar 2008

    Posted 26 Apr 2010 Link to this post


    Hello Victor

    I am having a similar problem. Visual Studio is trying to use a telerik assembly (which it calls a Component Assembly) that resides in different folder from the one in the referenced assemblies list(Designer Assembly).

    Here is the full text of the error message:

    ==========================================================================================================

    ---------------------------

    Visual Studio Error Detected

    ---------------------------

    Visual Studio is attempting to load class instances from a different assembly than the original used to create your components. This will result in failure to load your designed component. More information that will help you to correct the problem.

    Component Assembly:

    C:\Documents and Settings\Yosief.Kesete\Local Settings\Application Data\Microsoft\VisualStudio\9.0\ProjectAssemblies\aoxm94wn01\Telerik.WinControls.GridView.dll

    Designer Assembly:

    C:\Program Files\Telerik\RadControls for WinForms Q1 2010\bin\Telerik.WinControls.UI.Design.dll

    Please close Visual Studio, remove the errant assembly and try loading your designer again.

    Ensure that you do not attempt to save any designer that opens with errors, as this can result in loss of work. Note that you may receive this message multiple times, once for each component instance in your designer.

    ---------------------------

    OK  

    ---------------------------


    ==========================================================================================================



    Any idea why that happening? Please help ASAP as I have spent 15 hours trying to figure why.

    Thank you in advance
    Yosief Kesete



  5. Yosief
    Yosief avatar
    26 posts
    Member since:
    Mar 2008

    Posted 26 Apr 2010 Link to this post


    Hello again

    And this is what gets displayed in the second message box:

    ===================================================================


    ---------------------------

    Error

    ---------------------------

    An exception occurred while trying to update the data smart tasks, they will be disabled.

     

     

    Property accessor 'DataSource' on object 'Telerik.WinControls.UI.Design.RadGridViewDesigner' threw the following exception:'[A]Telerik.WinControls.UI.RadGridView cannot be cast to [B]Telerik.WinControls.UI.RadGridView. Type A originates from 'Telerik.WinControls.GridView, Version=2010.1.10.308, Culture=neutral, PublicKeyToken=5bb2a467cbec794e' in the context 'LoadNeither' at location 'C:\Documents and Settings\Yosief.Kesete\Local Settings\Application Data\Microsoft\VisualStudio\9.0\ProjectAssemblies\aoxm94wn01\Telerik.WinControls.GridView.dll'. Type B originates from 'Telerik.WinControls.GridView, Version=2010.1.10.308, Culture=neutral, PublicKeyToken=5bb2a467cbec794e' in the context 'LoadFrom' at location 'C:\Program Files\Telerik\RadControls for WinForms Q1 2010\bin\Telerik.WinControls.GridView.dll'.'

    ---------------------------

    OK  

    ---------------------------


    ===================================================================





    The following gets displayed in the last message box:

    ===================================================================

    ---------------------------

    Microsoft Visual Studio

    ---------------------------

    The control Telerik.WinControls.UI.RadGridView has thrown an unhandled exception in the designer and has been disabled. 

     

     

    Exception:

    Object reference not set to an instance of an object.

     

     

    Stack trace:

    ---------------------------

    OK  

    ---------------------------


    ===================================================================











  6. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 29 Apr 2010 Link to this post

    Hello Yosief,

    Please find the answer to your question in the following forum thread:
    http://www.telerik.com/community/forums/winforms/general-discussions/assembly-confusion-in-telerik-winforms.aspx

    Sincerely yours,
    Nikolay
    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready