Hello,
I'm trying to build my application on Azure DevOps hosted agents and seem to have some issues with embedding the license. Since build agent are created each time build runs it can't use license.licx file and license installed on a system.
Instead, I compiled license on dev machine, got compiled *.licenses files and embedded them instead.
This should work as that *.licenses files are one actually embedded even when you use license.licx file, and it works for the other licensed component in the project, but not for dotConnect for Postgres. Compiled app fails with error "License not found".
I wonder is there a way to compile project with proper license in this manner, I mean without installing license on build agents? Where can I find any info about it?
Thanks in advance.
Embedding license when building on Azure DevOps
Re: Embedding license when building on Azure DevOps
If you set up a pipeline for compiling your source code from repository on a build server periodically or even after every commit, you should add a step to your pipeline for installing the provider on the build server for copying Devart.* assemblies, registering provider build action, enabling automatic generation of .NET Framework license resource from provider entry in licenses.licx. For example, the corresponding step in Azure DevOps Pipeline can be the following one if you copied the provider installation to the root folder of your repository:
Code: Select all
- task: CmdLine@2
inputs:
script: '$(Build.SourcesDirectory)\dcpostgresql.exe /TYPE=FULL /VERYSILENT'
Re: Embedding license when building on Azure DevOps
Thanks for the info, Shalex.
I actually made it to work with the precompiled dll.licenses and exe.licenses files. The reason of error I was getting was the following:
After that everything is working as it should.
I actually made it to work with the precompiled dll.licenses and exe.licenses files. The reason of error I was getting was the following:
- I placed *.licenses files in the same place as *.licx, i.e. the Properties folder.
- When the project *.licx is compiled, lc.exe adds an embedded resource with name of "AssemblyName.(dll|exe).licenses".
- But, if add the already pre-compiled *.licenses to the Properties folder and make it the embedded resource, it will get name "AssemblyName.Properties.(dll|exe).licenses".
- Not sure why Devart didn't get it (the other licensed component I use were getting license correctly).
Code: Select all
<EmbeddedResource Include="Properties\exe.licenses">
<LogicalName>AssemblyName.exe.licenses</LogicalName>
</EmbeddedLicense>