License.licx File and Licensed/Unlicensed machines

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?

Answers


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.


Need Your Help

Low-resource, targetted and full-screen captures, why C#?

c# c++ programming-languages screen-capture image-capture

I would like to be able to capture screenshots with C++ 'using a lot of compression', and/or more importantly 'uses very few system resources when capturing'. I have been looking for concise,

ASIHTTPRequest in iOS

iphone objective-c asihttprequest

I have been using ASIHTTPRequest for an application but it gives me error in topSecretFetchFailed method 5 out of 10 request, Not sure how to deal with it, Isn't ASIHTTPRequest stable enough?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.