I modified an Infragistic Control in VB.Net and have added it to my toolbox. When I drop it on a form, it does not load the references and throws errors in VS 2010. What do I need to hook up possibly to make this happen?
Hello Vic,
It’s entirely up to Visual Studio to detect the references that are required and we have no control over this process. Visual Studio just gets the references that are directly referenced by the class and load them, but not the dependencies of those references. A way to work around it is to reference types that exist in the other assemblies.
I am sending you a simple control created by me which you could add to the toolbox. Please see attached zip and notice how types that exist in the other assemblies are referenced in order to be loaded.
public partial class UserControl1 : UltraButton
{
private Infragistics.Win.UIElement pointlessUIElement;
private Infragistics.Shared.DisposableObject pointlessDisposableObject;
public UserControl1()
InitializeComponent();
}
private void ultraButton1_Click(object sender, EventArgs e)
MessageBox.Show("I'am a control");
Atanas,
Just wanted to share what we learned about VS 2010 in the process. For starters, with third-party controls such as Infragistics, you need to be explicit as VS has trouble with obscured items deeper in the code rather than out front and obvious. Also, it must load the references when the item is actually placed into the toolbox. We had tried your solution prior to you giving it without success. I guess VS doesn't look at the latest/greatest version, only the one you load which kicks off the reference binding. When we saw your response, we revisited the scenario and got it working. Whatever the case, I can now move forward confidently.
Thanks for the help.
Vic
Thank you for your feedback. I am glad you have managed to make your scenario work.
Please do not hesitate to contact me if you have any further question.