Thursday, October 25, 2007

.net license files

I've been working on an issue with getting licenses to work with Janus Systems Controls and have the controls work when my application is deployed. When assemblies requiring licenses are deployed, you have to create a .license file using a License Compiler and then embed the same into your application using the Assembly Linker. Thankfully Visual Studio does all this for you when you are using assemblies requiring licenses. This is done by creating the licenses.licx file (which resides under the Properties folder) and then embedding the .license file in the output of the project.

The issue that I had was when I migrated my code from one development machine to another the licx files were not copied over and therefore there were no licenses embedded with the new application output. Since I had Janus Controls installed on my development machine I did not face any issues but when the application was deployed the end users would get an unauthorized application error whenever a form using one of Janus controls was shown.

Unfortunately, Janus Systems is an obscure little organization having no real support for their controls (most of the world has moved to Infragistics), but I did get some help from a co-worker. Here are the troubleshooting steps for all those who face the same issue that I did:

If you have problems with licenses it can be because of the following reasons:

a) The Original Licensed Setup is not installed in your machine at the time you compile the application.

b) The BIN folder in your solution contains a copy of the TRIAL version of the dlls instead of using the LICENSED version of the controls. To solve this problem you need to delete the OBJ and BIN folders of the project and do a full rebuild in a machine where the Trial Setup was removed and the LICENSED setup is installed.

c) The name of your exe contains spaces in it or you have renamed the exe after compiled.

d) There is no licenses.licx referenced in your project (note: The CustomBuild action for the file must be set as Embedded Resource)

e) One of the controls that you try to deploy is not listed in the licenses.licx file of your project at the time you compile your solution. If this is the case all you have to do is to edit the file using notepad and add the appropriate controls.

The points noted above are not limited to Janus. These are troubleshooting steps for any application requiring licenses.

If it is an issue with the licenses.licx file for Janus, the following entries are required in the same (if you are using Janus Controls v2):

Janus.Windows.ButtonBar.ButtonBar, Janus.Windows.ButtonBar.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.CalendarCombo.CalendarCombo, Janus.Windows.CalendarCombo.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UIButton, Janus.Windows.UI.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UICheckBox, Janus.Windows.UI.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UIColorButton, Janus.Windows.UI.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UIColorPicker, Janus.Windows.UI.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UIComboBox, Janus.Windows.UI.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UIFontPicker, Janus.Windows.UI.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UIGroupBox, Janus.Windows.UI.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UIProgressBar, Janus.Windows.UI.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UIRadioButton, Janus.Windows.UI.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.ExplorerBar.ExplorerBar, Janus.Windows.ExplorerBar.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.EditControls.EditBox, Janus.Windows.GridEX.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.EditControls.IntegerUpDown, Janus.Windows.GridEX.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.EditControls.MaskedEditBox, Janus.Windows.GridEX.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.EditControls.MaskEdit, Janus.Windows.GridEX.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.EditControls.MultiColumnCombo, Janus.Windows.GridEX.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.EditControls.NumericEditBox, Janus.Windows.GridEX.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.EditControls.NumericEdit, Janus.Windows.GridEX.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.EditControls.ValueListUpDown, Janus.Windows.GridEX.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.GridEX, Janus.Windows.GridEX.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.Schedule.Calendar, Janus.Windows.Schedule.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.Schedule.Schedule, Janus.Windows.Schedule.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.UI.CommandBars.UICommandManager, Janus.Windows.UI.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.UI.Dock.UIPager, Janus.Windows.UI.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.UI.Dock.UIPanelManager, Janus.Windows.UI.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.UI.StatusBar.UIStatusBar, Janus.Windows.UI.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.UI.Tab.UITab, Janus.Windows.UI.v2, Version=2.0.1131.0, Culture=neutral, PublicKeyToken=21d5517571b185bf

For v3, here are the entries required in the licenses.licx file:

Janus.Windows.ButtonBar.ButtonBar, Janus.Windows.ButtonBar.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.CalendarCombo.CalendarCombo, Janus.Windows.CalendarCombo.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UIButton, Janus.Windows.UI.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UICheckBox, Janus.Windows.UI.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UIColorButton, Janus.Windows.UI.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UIColorPicker, Janus.Windows.UI.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UIComboBox, Janus.Windows.UI.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UIFontPicker, Janus.Windows.UI.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UIGroupBox, Janus.Windows.UI.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UIProgressBar, Janus.Windows.UI.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UIRadioButton, Janus.Windows.UI.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.EditControls.UITrackBar, Janus.Windows.UI.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.ExplorerBar.ExplorerBar, Janus.Windows.ExplorerBar.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.EditControls.CheckedComboBox, Janus.Windows.GridEX.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.EditControls.EditBox, Janus.Windows.GridEX.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.EditControls.IntegerUpDown, Janus.Windows.GridEX.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.EditControls.MaskedEditBox, Janus.Windows.GridEX.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.EditControls.MaskEdit, Janus.Windows.GridEX.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.EditControls.MultiColumnCombo, Janus.Windows.GridEX.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.EditControls.NumericEditBox, Janus.Windows.GridEX.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.EditControls.NumericEdit, Janus.Windows.GridEX.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.EditControls.ValueListUpDown, Janus.Windows.GridEX.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.GridEX.GridEX, Janus.Windows.GridEX.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.Schedule.Calendar, Janus.Windows.Schedule.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.Schedule.Schedule, Janus.Windows.Schedule.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.TimeLine.TimeLine, Janus.Windows.TimeLine.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.UI.CommandBars.UICommandManager, Janus.Windows.UI.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.UI.Dock.UIPager, Janus.Windows.UI.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.UI.Dock.UIPanelManager, Janus.Windows.UI.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.UI.StatusBar.UIStatusBar, Janus.Windows.UI.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.UI.Tab.UITab, Janus.Windows.UI.v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf

For v3.5 replace all of the above Version=3.0.0.0 with Version=3.5.0.0 and add the following:

Janus.Windows.Ribbon.Ribbon, Janus.Windows.Ribbon.v3, Version=3.5.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.Ribbon.OfficeFormAdorner, Janus.Windows.Ribbon.v3, Version=3.5.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
Janus.Windows.Ribbon.RibbonStatusBar, Janus.Windows.Ribbon.v3, Version=3.5.0.0, Culture=neutral, PublicKeyToken=21d5517571b185bf

Now, make sure the bin and obj files of the project file are clean and then recompile. You should be all set!

2 comments:

Anonymous said...

We're licesed user of Janus suite v2. We have had weird problems with v2. Quite often they were fixed after applying patches. There were regressions as well.

The license problem you mentioned was another annoyance. We had a dummy Form included in our project, and remove & drop Janus controls whenever we had the license problem so that the license file was regenerated.

Now we need to decide if we pay $400 per license for upgrade to v3.x. Maybe Infragistics is a wise choice as you said I can't expect reasonable support from Janus.

Unknown said...

I'd move to Infragistics at the drop of a hat. A lot of my code has been written such that the properties of the controls are accessed using methods in common classes and I only use those methods in my forms. I'd move to Infragistics when I get more upper level support.