Whatdoes Licenses.licx really do for DevExpress controls? I deleted all the lines in the licenses.licx and there is no difference. I successfully compiled and run my application. I am suprised with this behavior. Can anyone explain me the details about what is happening?
The licenses.licx file contains licensing information about controls used in the your application. It is then compiled into the App_Licenses.dll. It should be deployed along with your web site when you deploy the project. If you need to regenerate the App_Licenses.dll, right click the licenses.licx file in the solution explorer and choose the "Build Runtime Licences" command.
Licenses.licx is actually a file in your solution (if you cannot seeit there, click Show All Files). Visual Studio uses a program calledlc.exe to compile the licenses into embedded resources in yourapplication
The first value in this comma delimited list is the class, the secondis the assembly where it's found, and the other values are the rest ofthe assembly's strong name. I'm sure you can see problems already,especially when you upgrade a solution to the latest versions of thethird-party controls you use. If you want, you can edit this file andremove the strong name parts with no problem.
The thing is Visual Studio has a propensity of touching this file ifyou open the solution (that's "touching" as in changing the file dateto the current date/time). This plays havoc with licensing, especiallyif you happen open the solution on a non-licensed machine and you areusing source control. Suddenly your build machine will throw off these"cannot transform" messages and you're left wondering what went wrong.Another prevalent issue is when you have a team of developers workingon a solution: they're all unconsciously "modifying" this file.
Usually, the licenses.licx file is created when the control is dragged and dropped on the windows form, XAML page or webpage. If multiple ComponentOne controls are used in the application, then entries of these controls are created in the same licensing file in the order they are dropped. This licenses.licx file contains information in the Control name, Assembly name, Product Version, Culture, PublicKeyToken order.
All ComponentOne controls, VisualStudio, and the assembly on your machine all work together through a file called licenses.licx. If you're new to using third party controls, you may have never seen this file in your life. If you're working on a pre-existing project, it may be available in the Solution Explorer underneath the Project Name > Properties > licenses.licx. However, if it is not available in your project, you can add it yourself by following these steps:
For example, if you want to generate license for the FlexChart control in a WPF application, add the Namespace as C1.WPF.Chart, the class in the FlexChart as C1FlexChart, and the DLL where all of this is coming from as C1.WPF.FlexChart.4.5.2, as depicted in the image below.
The Microsoft .NET Framework has a built-in, extensible licensing architecture that supports design-time and run-time licensing for managed components, including Windows Forms controls,
ASP.NET server controls and WPF controls (Applications Licensing using the .NET Framework).
Most of the functionality you need as a customer of third-party components is already embedded into Visual Studio. When you drop a third-party control from the toolbox onto the design surface, VS creates a text file with .licx extension, adds it to the project as an embedded resource, and fills it with information about the controls. Then, when you build the project on a machine with an installed license, the License Compiler reads text files that contain the licensing information and produces a binary output that's embedded into runtime, executable as a resource. When you run this application on any machine, components don't need the license installed on computer; they only check the license embedded into application manifest. That's it in theory.
Of course, things go wrong. You might edit your code manually, and then the IDE couldn't generate a valid .licx file for your app. Or you could upgrade binaries to a newer version. Or someone from your team could override this file content, etc. If there's something wrong with .licx file in your project, you might get build errors, or even worse - your customers might get nag screens or runtime exceptions even if you have valid license.
The popularity of our Licensing Problems - The licenses.licx File and You blog post shows how frequently this problem crops up. The post describes what should be included in the WinForms licenses.licx file, and how you can fix it manually. It's all the same for our WPF controls and for WinForms and WPF controls of other vendors. You can do it manually, but on big projects it's not always easy to find what is missing.
Fortunately, this task can be automated, and many thanks to our customer Dom Sinclair for inspiration. The attached LicxGenerator tool creates a license.licx file with license information entries for all controls found under a specified path. If you run it, it asks you to browse for the binaries folder and then put the generated file under the same path. If you need more control, you can run it with command line options. You can also run it with other automated tasks.
If both sourcePath and -s parameter are not set, the utility will show the folder selection dialog. If the outputPath is not set, it will be the same as sourcePath value.
This free tool will save you a lot of time on digging into licensing issues. We also attached full source code in case if you want to play with it. Please feel free to share your feedback and suggestions.
This compile error occurs when Visual Studio fails to embed a license file into the resource using a licenses.licx file. DotImage 2.1 and later will display a message box with details of the error. With DotImage 2.0 and older, you will need to remove or rename the licenses.licx file, and run your application for more details of the exception.
3a8082e126