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

Binding context error

4 Answers 171 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Anthony Daniel
Top achievements
Rank 1
Anthony Daniel asked on 05 Feb 2009, 11:28 PM
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?

4 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 09 Feb 2009, 04:54 PM
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.
0
Yosief
Top achievements
Rank 2
answered on 26 Apr 2010, 09:18 AM

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



0
Yosief
Top achievements
Rank 2
answered on 26 Apr 2010, 09:56 AM

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  

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


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











0
Nikolay
Telerik team
answered on 29 Apr 2010, 07:07 AM
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.
Tags
General Discussions
Asked by
Anthony Daniel
Top achievements
Rank 1
Answers by
Victor
Telerik team
Yosief
Top achievements
Rank 2
Nikolay
Telerik team
Share this question
or