Pergunta

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?

Foi útil?

Solução 2

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.

Outras dicas

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.

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.

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top