4

In a VS2010 solution I have a license.licx file that contains:

DataDynamics.ActiveReports.ActiveReport, ActiveReports6, Version=6.1.2814.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff
DataDynamics.ActiveReports.Web.WebViewer, ActiveReports.Web, Version=6.1.2814.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff
DataDynamics.ActiveReports.Export.Pdf.PdfExport, ActiveReports.PdfExport, Version=6.1.2814.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff
DataDynamics.ActiveReports.Design.Designer, ActiveReports.Design6, Version=6.1.2814.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff
DataDynamics.ActiveReports.Viewer.Viewer, ActiveReports.Viewer6, Version=6.1.2814.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff

If I build the solution on a machine that HAS a license for ActiveReport then everything is fine. If I build the solution on a machine that DOESN'T have a license for ActiveReport I get:

Error 1 'Could not load file or assembly 'ActiveReports6, Version=6.1.2814.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)' LC

On the machine that DOESN'T have a license for ActiveReport if I remove the above lines from the license.licx file then everything builds fine. I always thought that if the license couldn't be found then the unlicensed version will be used but it wouldn't kill the build. How do I get this solution to build on any machine whether it has a license or doesn't?

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Denis
  • 11,796
  • 16
  • 88
  • 150

4 Answers4

3

It actually seems like this machine doesn't have that specific version of ActiveReports installed.

We resolve issues like this by storing external assemblies in a path relative to the project (i.e. ..\Assemblies) and modifying all of the projects to include a HintPath, for example:

<Reference Include="ActiveReports3">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\..\..\..\Assemblies\ActiveReports3.dll</HintPath>
</Reference>

This way, you don't have to worry about every developer having the exact same version installed. You should be able to debug with this configuration, but not build for release.

Update

I forgot to mention another practice that we implement: unless the component absolutely requires it (we only have one that I can think of off the top of my head), we never store versions in the license.licx file. Our licenses.licx entry for the above example is:

DataDynamics.ActiveReports.ActiveReport3, ActiveReports3

You have to keep on top of the licenses.licx file if you do this, but it definitely resolves various versioning issues.

competent_tech
  • 44,465
  • 11
  • 90
  • 113
  • I don't think this is correct because if the version was wrong then no matter what I did it wouldn't compile. If I take the items out of the .licx file everything works fine, I just don't want people to have different .licx files. – Denis Dec 01 '11 at 19:58
  • @Denis: If the version was wrong, but you have specificversion = false in the project, then it will still compile. But since the exact version is specified in the licenses file, the lc will fail. I have updated my answer with additional information. – competent_tech Dec 01 '11 at 20:05
3

Contacted ActiveReports and they told me that a license file can be maintained for each user whether they have a paid license or not. The trick is that the users who will not be generating reports need to install a trial license (which ActiveReports provides free of charge) and the users that paid for the license will have their own license. The trial license, just like the real paid license, will deal with the license.licx file and will provide the proper actions when it sees an entry it recognizes in the .licx file.

Denis
  • 11,796
  • 16
  • 88
  • 150
2

If I build the solution on a machine that DOESN'T have a license for ActiveReport I get

This is part of the problem. Typically, licensing requires every developer to have a license. Trying to license only part of your development team is likely in violation of your ActiveReports license.

Reed Copsey
  • 554,122
  • 78
  • 1,158
  • 1,373
  • 5
    ActiveReports allows developers to design reports. When they are released they need to be compiled on a machine with a licensed version of ActiveReports in order to remove the BIG WATERMARK across the pages. But the licensing and all legal matters thereof is off topic, the main question is can you have a mix of licensed and unlicensed developers all sharing the same .licx file? Some developers will be able to produce reports without the watermark and some won't? – Denis Dec 01 '11 at 19:57
1

It should be perfectly fine to use a trial version of ActiveReports the way you are describing. I've seen a number of problems with Visual Studio's licensing with various components. Usually they can be solved using the following steps:

  • Clean the solution using Build > Clean
  • Delete the licx file (Visual Studio will generate this file as needed).
  • Add an ARViewer control to a form in your project (you can delete it again later). This needs done on a machine with a valid ActiveReports license. And this is what should trigger the licx file to be regenerated with the correct information.
  • Rebuild (make sure you do a real rebuild, I know that is supposed to be a clean+build, but rebuild seems to be important sometimes).

Other than that, just verify your references are all correct. For example, make sure you don't have multiple versions of DLLs referenced in different projects within the solution and make sure "Copy Local" and "Use Specific Version" are as you expect.

If you still have problems create a new project, add ActiveReports (or whatever component you're having problems with) and do a quick "hello world" style app to make sure it works correctly and then compare the two projects (references, files, etc.).

Scott Willeke
  • 8,884
  • 1
  • 40
  • 52
  • This is a dangerous solution because if you rebuild the license file will not be re-populated. The license file will only be populated if you drag a licensed control on your form - it doesn't happen during the build – Denis Dec 06 '11 at 16:06
  • 1
    The licx file can always be regenerated by VS by adding any licensed control to a windows form. I did update the steps above to make sure that this is done on a licensed AR machine. – Scott Willeke Dec 16 '11 at 02:08
  • Using some form of Version Control makes this far less dangerous. You can perform these steps, and copy the contents of the re-generated license.licx file. Then you can undo your changeset, and apply the contents of the regenerated license.licx file to the existing license.licx file, thus fixing that part of the licensing setup. – Andrew Gray Jun 03 '16 at 16:30