View previous topic :: View next topic |
Author |
Message |
Brian Guest
|
Posted: Thu Aug 18, 2005 5:47 pm Post subject: Code generation for property 'CellBindings' failed. Error |
|
|
When using the Object Data Binding features in the VS.NET, the following error occurs when exiting the Virtual Tree Designer.
Code generation for property 'CellBindings' failed. Error was: 'Specified cast is not valid.'
I'm currently using version 2.0.1 but everything seemed to work fine with version 2.0.0. However, after rolling back to 2.0.0, the error is now appearing as well.
Let me know if you need anymore information.
BTW, This control is awesome!!!
Thanks,
Brian |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Aug 18, 2005 10:24 pm Post subject: |
|
|
This problem can arise if the Visual Studio designer uses a different version of the Infralution.Controls.VirtualTree DLL to that actually referenced by your code. This aliasing seems to cause some code serialization problems for the IDE.
There are two possible ways this can happen:
1. If you derive a new control class and try using the designer for the control in the same solution or project. In this case the IDE needs to have a reference to the DLL in order to display the designer for it - but your project/solution is recompiling that DLL.
2. Your project references to the Infralution DLLs have inadvertantly been changed to "CopyLocal". This is generally a bad idea for DLLs that are installed in the GAC as it can cause aliasing - the designer will pick the DLL from the GAC but the code will use the locally copied DLL. When you add a reference to a DLL that is in the GAC the IDE will set CopyLocal to false by default for this reason.
You can fix the first issue by ensuring that you exit the IDE and reload the solution before attempting to use the designer to edit instances of your derived control within the same project. This causes the IDE to load the correct latest version of the compiled DLL and you shouldn't then have any problems.
The second issue can be addressed by deleting the Infralution DLL references and readding them - checking that CopyLocal is set to false.
If you do get code generation errors when making changes in the designer make sure you don't save the changes to the form - as this will typically save incorrectly generated code that obliterates your previous settings. _________________ Infralution Support |
|
Back to top |
|
|
|