Skip to main content Skip to footer

Error: Could not load file or assembly

Sometimes after upgrading your WinForms projects containing ComponentOne controls you may get this error. It occurs because there still exists a reference to an older version of a C1 control (for example, C1Ribbon here) in the project.

FileLoadException WinForms

Solution 1

Unblock the control’s dll and then try using it in your application. To unblock the dll, right click on the dll and select 'Properties'. In the 'General' tab of the Properties, select the 'Unblock' option. 

Unblock DLL

Solution 2

  1. Delete the old references from the References tab in Solution Explorer.

  2. Delete the licenses.licx file and clean the solution.

  3. Close Solution and Close VS because at times VS has some weird behavior to keep the cache to hold dll references.

  4. Delete bin and obj folders from application folder.

  5. Open VS and check application's framework- it should not be Client Profile version.

  6. Add a new Form.

  7. And then drag drop all the controls ( of the latest version) being used in your application. This will create licenses.licx file along with adding references in the solution explorer References tab.

  8. Rebuild the project. And it should work.

Also, check the specific control’s dll version in GAC. It should be the same version which you want to use in your application.