(Print this page)

Strange bug using Telerik controls preventing the Windows Forms to show the designer
Published date: Friday, February 17, 2017
On: Moer & Éric Moreau's web site

I was the victim of a very strange bug that just stole about 3 precious hours of my life!

The symptom was that neither Visual Studio 2015 nor 2017 RC were able to open forms containing Telerik controls. Even the error was different from one form to the other.

Some of the errors shown instead of the form in the designer were:

  • Value cannot be null. Parameter name: instance 
  • Duplicate declaration of member '<member name>'
  • Designer Load Exceptions - Object Reference not set to an instance of an object.

After having cleaning the solution, rebuilding the solution, rebooted the computer, compared the latest modified files against my source code control history, tried on another computer, repaired my Visual Studio installation (that took more than 1 hour alone), I finally found something.

The solution is actually quite simple. Apparently my installation is broken (probably because I wasn't running Visual Studio as an administrator the last time I have upgraded Telerik) and the GAC is containing a different (older) version than the one I am referencing in my project. Just by adding Telerik.WinControls.UI.Design.dll to all the projects of my solution and rebuilding, the forms were finally able to show on the designer.

This solution was found at http://www.telerik.com/forums/on-every-new-project-value-cannot-be-null-parameter-name-instance 


(Print this page)