On every new project: Value cannot be null. Parameter name: instance

15 posts, 1 answers
  1. losol
    losol avatar
    10 posts
    Member since:
    Aug 2004

    Posted 12 Apr 2015 Link to this post

    Trying the trial of the Telerik suite for WinForms in Visual Studi 2013, but any time I try to make new Telerik winforms projects I get the same error message when trying to open the form: 

       To prevent possible data loss before loading the designer, the following errors must be resolved:              1 Error         Why am I seeing this page?             Value cannot be null. Parameter name: instance              Instances of this error (1)   1.   Show Call Stack   at System.ComponentModel.TypeDescriptor.AddAttributes(Object instance, Attribute[] attributes)at Microsoft.VisualStudio.Design.VSDesignSurface.CreateDesigner(IComponent component, Boolean rootDesigner)at System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo)at System.ComponentModel.Design.DesignerHost.PerformAdd(IComponent component, String name)at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)     
  2. Answer
    Ralitsa
    Admin
    Ralitsa avatar
    185 posts

    Posted 14 Apr 2015 Link to this post

    Hi Ole Kristian,

    Thank you for contacting us. 

    You need to follow these steps to remove the error: 
    1. Open the project 
    2. Add the Telerik.WinControls.UI.Design.dll in the reference 
    3. Save changes and close the project
    4. Open the application and rebuild it. 

    I also attached a video (drag and drop it over your browser to play it) which demonstrates the approach. 

    The error is caused when have installed one version of controls in GAC and the project references another version of the dlls. If you use RadForm or if you want to make changes at design time, you need to add the Telerik.WinControls.UI.Design.dll when working with version different from installed one. 

    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Ralitsa
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. na
    na avatar
    1 posts
    Member since:
    Sep 2015

    Posted 27 Nov 2015 in reply to Ralitsa Link to this post

    Hi Ralisa,

     It helped me. Thanks

  4. Indudhar
    Indudhar avatar
    1 posts
    Member since:
    Aug 2015

    Posted 16 Dec 2015 in reply to Ralitsa Link to this post

    Thank You...It worked for me as well
  5. peter
    peter avatar
    1 posts
    Member since:
    Sep 2014

    Posted 29 Sep 2017 in reply to Ralitsa Link to this post

    Perfect solution. Thanks
  6. Jeff
    Jeff avatar
    5 posts
    Member since:
    Jun 2013

    Posted 20 Oct 2017 in reply to Ralitsa Link to this post

    This didn't work for me. My project was working fine in VS2017. I used control panel to install the tools to VS 2013. Now my 2017 project won't load/compile correctly. I get numerous errors like the one below. I tried adding the UI.Design and even completely reinstalling the suite for 2017. No luck.

     

    SeverityCodeDescriptionProjectFileLineSuppression State

    ErrorCS1705Assembly 'Telerik.WinControls.GridView' with identity 'Telerik.WinControls.GridView, Version=2017.3.1017.40, Culture=neutral, PublicKeyToken=5bb2a467cbec794e' uses 'Telerik.WinControls, Version=2017.3.1017.40, Culture=neutral, PublicKeyToken=5bb2a467cbec794e' which has a higher version than referenced assembly 'Telerik.WinControls' with identity 'Telerik.WinControls, Version=2017.3.912.40, Culture=neutral, PublicKeyToken=5bb2a467cbec794e'CredMan

  7. Ralitsa
    Admin
    Ralitsa avatar
    185 posts

    Posted 23 Oct 2017 Link to this post

    Hi Jeff,

    Thank you for contacting us. 

    I would like to ask you to carefully check the references to all Telerik controls in your project and make sure that they are the same version considering the suffix as well (.20 or .40). Better yet, you can remove all references and add them anew by using the DLLs from your latest installation. If the license.licx file exist, you need to delete it (Visual Studio Project >> Properties >> Licenses.licx) . After that, you should rebuild your project, close Visual Studio and open it again to make sure that no references are kept in the memory by Visual Studio.  

    I hope this information helps. Should you have further questions I would be glad to help.

    Regards,
    Ralitsa
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  8. Jeff
    Jeff avatar
    5 posts
    Member since:
    Jun 2013

    Posted 23 Oct 2017 in reply to Ralitsa Link to this post

    Hi Ralitsa,

    I recently removed all the dlls and added them in. They are all version .20 and the issue still exists.

    Thanks.

  9. Ralitsa
    Admin
    Ralitsa avatar
    185 posts

    Posted 26 Oct 2017 Link to this post

    Hello Jeff,

    Thank you for writing back. 

    The observed exception is shown when the referenced assemblies are different or the license.licx is not deleted. Once you have checked and update the referenced assemblies in your application, I can suggest you deleting the license file. You can follow the steps below: 
    1. Run Visual Studio and open your project
    2. Close all opened forms. Delete license.licx file (see attached image) 
    3. Save the changes and close the Visual Studio
    4. Open the project again and rebuild. 

    Let me know if you have any other questions.

    Regards,
    Ralitsa
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  10. John
    John avatar
    4 posts
    Member since:
    Nov 2017

    Posted 04 Jan in reply to Ralitsa Link to this post

    Thank you in advance for all the help.

    I also tried the suggestions listed before, but am experiencing the same problems as Jeff.

    Using VS2017, I deleted the license file, removed/verified all .dll are same versions, and cleared any resident GAC entries.

     

  11. John
    John avatar
    4 posts
    Member since:
    Nov 2017

    Posted 04 Jan in reply to John Link to this post

    Just so it's clear.... My error is the following call stack in designer:

    Value cannot be null. Parameter name: instance



    Instances of this error (1)

    1. Hide Call Stack
    at System.ComponentModel.TypeDescriptor.AddAttributes(Object instance, Attribute[] attributes)
    at Microsoft.VisualStudio.Design.VSDesignSurface.CreateDesigner(IComponent component, Boolean rootDesigner)
    at System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo)
    at System.ComponentModel.Design.DesignerHost.PerformAdd(IComponent component, String name)
    at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)
    at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
    at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)

  12. John
    John avatar
    4 posts
    Member since:
    Nov 2017

    Posted 04 Jan in reply to John Link to this post

    Just so it's more clear.... It's the error preventing the designer from loading.

    Attaching stack trace....

     

  13. Dess
    Admin
    Dess avatar
    2296 posts

    Posted 05 Jan Link to this post

    Hello, John,  

    Thank you for writing.  

    Could you please try to create a new project and test whether the designer will be opened? Further, I can suggest you to uninstall all available versions of the Telerik UI for WinForms suite on your machine. Then, install the desired version (latest version is recommended). Delete the license file and update the references with the ones from the fresh installation.

    If you are still experiencing any further difficulties, it would be greatly appreciated if you submit a support ticket and provide your sample project. Thus, we would be able to investigate the precise case and assist you further. 

    I hope this information helps.  
     
    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  14. John
    John avatar
    4 posts
    Member since:
    Nov 2017

    Posted 05 Jan in reply to Dess Link to this post

    Ok. I found out why I was having problems. There are/were 2 issues....

    First, designer errors using regular forms was caused by multiple problems (different DLL versions (GAC vs. local reference) and problems with AutoGenerateBindingRedirect). This was solved using the provided idea of absolutely killing all Telerik controls and installs, manually removing any remaining orphaned Telerik GAC entries(from older installs not using MSI which is what was causing a lot of issues), flushing all Telerik project references and license files, kill any binding overrides/redirects, then go back into solution and manually reference the DLLs not using the MSI to re-install.

    Second problem is totally my fault for not paying attention.... I'm using VS2017 and attempting to use Telerik Reporting which doesn't have (as far as I can tell) VS2017 native support (goes up to VS2015), so when I tried to open an older report file it threw the form design error as well (but a slightly different one).

    However, as usual, Telerik support is responsive and helpful. Many thanks. - John

  15. Dess
    Admin
    Dess avatar
    2296 posts

    Posted 08 Jan Link to this post

    Hello, John, 

    Thank you for writing back. 

    I am glad that the problem you were facing is now resolved. A clean installation of the Telerik UI for WinForms suite and referring these assemblies usually fixes the designer problems because the design time uses the references in GAC.

    If you have any additional questions, please let me know. 

     Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top