I'm trying to deploy my code to a Build Machine on AppVeyor, and I Found that I need to create a postsharp.config file with my license details to build, but I'm having the following error:
C:\projects\webapibase\packages\PostSharp.5.0.41\build\PostSharp.targets(314,5): error PS0260: License error. The license xxx is not allowed to be loaded from C:\projects\webapibase\Service\postsharp.config. [C:\projects\webapibase\Service\Service.csproj] C:\projects\webapibase\packages\PostSharp.5.0.41\build\PostSharp.targets(314,5): error PS0242: License error. No valid license key has been installed. Please visit https://www.postsharp.net/purchase to acquire a license of PostSharp. To register a license key, use PostSharp Essentials or start the evaluation period, execute the program
I have created the postsharp.config file:
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.postsharp.org/1.0/configuration">
<License Value="xxxx" />
</Project>
Ps. The same project in VSTS build normally (without the file), probably PostSharp detects a build machine and ignore the license check.
Fixed it, the solution is add the RegKey before Build:
REG ADD "HKEY_CURRENT_USER\Software\SharpCrafters\PostSharp 3" /v LicenseKey /t REG_SZ /d <your_license>