debugging error: Licenses.licx : unable to resolve type

29.2k Views Asked by At

I am using a ComponentOne FlexGrid, it automatically registered in its license

C1.Win.C1FlexGrid.C1FlexGrid, C1.Win.C1FlexGrid.2, Version=2.6.20122.716, Culture=neutral, PublicKeyToken=79882d576c6336da

I also use a custom control that inherits the C1FlexGrid, but on run-time it tries to register

DataTree.C1FlexDataTree, fpstudio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

in the license file, which ultimately creates an error:

Error 51 Unable to resolve type 'DataTree.C1FlexDataTree, fpstudio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' C:_DEVELOPMENT_FP_DRAFT12\COMPONENT1_WORKING_MERGED\fpstudio\Properties\licenses.licx 3 Freepour Studio

How can I tell this class not to try to license the control as it already is inherited and is licensed itself. I have already removed [LicenseProvider()] from the DataTree Class

4

There are 4 best solutions below

0
On

I think the only way to do it is to edit licenses.licx file manually and remove DataTree.C1FlexDataTree from there. Note, VS edits licenses.licx file automatically when you work with forms and controls in designer. If you close all designer windows and edit licx file manually, your changes will be saved and you can avoid issues. The most common issue with licx files is build error after you updated controls to other version. To avoid it, you can just remove version and public key token information from this file at all. After that it would work with any version. I.e. you licenses.licx file content should look like this:

C1.Win.C1FlexGrid.C1FlexGrid, C1.Win.C1FlexGrid.2
DataTree.C1FlexDataTree, fpstudio

(or without DataTree.C1FlexDataTree line). Note, if you open designer to do some changes, VS can edit this file again. There is no way to prevent that. You'll have to edit file once more time.

0
On

I found the solutions was to open a new blank form in the project, add to that form every object that comes with your library. Then perform a "Build" and Visual Studio updates your .licx file with the correct info on the added objects, overwriting any old date held in that file. All "non-resolved" types associated with your file will be removed.

0
On

In my case the solution was pretty simple, just open the file licenses.licx, empty the content, save the changes and run your solution again. Note: Don't delete the file, just empty the content.

Hope this works for you.

1
On

This is a pain... I'd suggest you install the EmptyLicensesLicx nuget package, and it will make sure there's an empty Licenses.licx in your project, before it gets compiled (which is all you need).