开发者

Embeding a licenses.licx file into an exe using MSBuild via a NAnt script

We have an automated build setup using TeamCity for our application. This application uses Active Reports 6, which use a license.licx file for licensing. When I build using Visual Studio on the build machine, everything is cool and the license is recognized when I distribute my application to others.

The problem is that our build server goes with MSBuild. When built using MSBuild, with the same license.licx file, it does not get embedded properly into our executable, and the AR6 watermark appears on the reports.

Upon contacting the ActiveReports support, they offered me to use the LC.exe tool to generate a .licenses file, and then use the C# command line compiler (CSC) to compile my .licenses file into my application. This did not work for me.

The NAnt task that calls MSBuild is the following :

<exec program="${msbuild}">
  <arg value="${solution}" />
  <arg value="/p:Configuration=${config}" />
  <arg value="/t:rebuild" />
</exec>

Variables used:

property name="msbuild" value="C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe"

property name="solution" value="project.sln"

property name="config" value="release"

Note that I removed < and /> from properties here because they don't seem to show up because of the quote system (>)

Can we embed properly the license.licx file into my executable when building using MSBuild?

Thanks开发者_StackOverflow


I solved the problem finally. It turned out to be our build server running under the SYSTEM account, when the ActiveReports license was installed using the admin account on the machine.

Running the TeamCity service (our build server) as the admin account solved our issue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜