debugging error: Licenses.licx : unable to resolve type
Asked Answered
P

4

11

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

Pandean answered 30/11, 2012 at 20:17 Comment(3)
I don't know if this will end up helping you, but whenever we have ComponentOne issues with licensing, we just create a blank form, add the proper components, then rebuild the application. ComponentOne will then properly add the licenses to the file. Alternatively, are you sure you're referencing the right version? Have you tried "Specific Version" = false on the reference?Belanger
Do you have the property Compile operation set to 'Embedded Resource' for the licenses.licx?Bloodyminded
Build Action: Embedded Resource is what I have. I think @notacat's answer is correct. You can't prevent it, but you can just edit the licenses.licx file to remove the offending entry (in my case, the class I created that extends the licensed third party component.) It will later be added any time I edit a form that uses that component, but it can be re-removed. Annoying, but simple enough.Hessenassau
I
11

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).

Interpretive answered 24/11, 2016 at 22:29 Comment(1)
I wish I had have found this package so long agoDecane
D
2

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.

Dives answered 26/2, 2013 at 11:47 Comment(0)
H
0

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.

Hampson answered 30/5, 2020 at 4:13 Comment(0)
N
0

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.

Nicolasanicolau answered 11/7, 2022 at 17:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.