I have \"inherited\" a new (old?) Winforms project and would like to put it onto our build server (Bamboo). That build server has only the absolute minimum (.NET 3.5 and not muc
To complement the answers above (i.e. resolving the issue by creating an empty licenses.licx file), you can install the EmptyLicensesLicx nuget package, and it will generate an empty Licenses.licx
in your project, before it gets compiled every time (which is all you need for it to work).
I could build Team City project based on answer by marc_s i.e. by replacing existing license file with blank licenses.licx.
But there was another hick up when i tried opening aspx pages having infragistics controls on local machine, it gives error as i have infragistics installed on local machine but my licenses.licx is blank.
I found a workaround for this as below:
<Target Name="BeforeBuild" Condition="$(Configuration)==CI_TeamCity_Build">
<CreateItem Include="$(MSBuildProjectDirectory)\licenses.licx">
<Output TaskParameter="Include" ItemName="EmptyLicensesLicx" />
</CreateItem>
<Copy SourceFiles="@(EmptyLicensesLicx)" DestinationFolder="$(MSBuildProjectDirectory)\Properties\" ContinueOnError="true" />
</Target>
Added 'BeforeBuild' target as mentioned by marc_s additionally i have added a condition that this task will be executed when my build is using 'CI_TeamCity_Build' and not for 'Debug' or 'Release' build
Team City build configuration is using above configuration in "VS Solution Build Runner" step. Due to 'BeforeBuild' target in csproj file, it replace license file with blank one and build succeeds.
On my local machine I continue using 'Debug' or 'Release' build as it won't replace licenses.licx file with blank one. All infragistics controls appear on .aspx page without any issue.
The only way I found to solve this problem is this:
licenses.licx
in my folder where the solution resideslicenses.licx
over all the existing licenses.licx
in the various projects' Properties
directoryWith this, now I have both my interactive experience working (since the proper licenses.licx
files are present), but my automatic build also doesn't break (since that empty licenses.licx
file I copied over all the real ones doesn't cause any aborts in the build)
Seems a bit hackish - but it works. Hope that helps someone, somewhere, some day.
Update: I added this BeforeBuild
step to my MSBuild build file to copy the empty *.licx
file to the locations I need:
<Target Name="BeforeBuild">
<CreateItem Include="licenses.licx">
<Output TaskParameter="Include" ItemName="EmptyLicensesLicx" />
</CreateItem>
<Copy SourceFiles="@(EmptyLicensesLicx)"
DestinationFolder="(your-target-folder-here)"
ContinueOnError="true" />
</Target>
Since I need to replace this *.licx file in several places, I actually have several of those <Copy>
tasks to achieve my goal.
We have components from other company but the approach should work if .Net licensing model is used in third-party library.
If you have licenses.licx
file then library probably uses .Net licensing model. During build process it uses lc.exe utility to build binary licenses file and then it is included in assembly as embedded resource.
What you need to do:
YourApp.exe.licenses
file using lc.exe. Other way is to build the solution that contains licenses.licx
and get it from obj\Debug
or obj\Release
directory. This step should be done on machine where the components are installed and registered. Also it may require to enter license code as in our case.YourApp.exe.licenses
to project as embedded resource.Open .csproj of your application and edit the entry for YourApp.exe.licenses
file. You will have something like this <EmbeddedResource Include="YourApp.exe.licenses" />
It should be changed to
<EmbeddedResource Include="YourApp.exe.licenses" >
<LogicalName>YourApp.exe.licenses</LogicalName>
</EmbeddedResource>
This is needed to exclude namespace from resource's name.
I'm not sure how the lc.exe works but you will probably need to rebuild YourApp.exe.licenses
file from time to time.
I ran into this problem recently using TeamCity 9.1 as my build server.
When we originally set up the build server, we didn't want to install Infragistics on the machine, so we created a References folder where we copied the required assemblies and checked them in. (I know this is undesirable but it's a work-around.)
Ensure that the projects reference the assemblies at the new path. This creates a HintPath entry in the project file(s) for each assembly.
Finally, edit the project file manually to add <Private>True</Private> to each reference. (It wasn't enough to set the Copy Local property to true.)