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?
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 you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With