EPiServer License information: A error occured while loading the license file.

Short note-to-self: if replacing contents of an Episerver license file using variables in Octopus Deploy, make sure the file uses the proper encoding, or you may find yourself facing the following error message:

License information: A error occured while loading the license file.

At a client of mine the Episerver license is written to the episerver.license-file using Octopus Deploy. Initially the file only contains the Octopus variable placeholder #{EpiserverLicense} which is then replaced for each environment.

If you’re doing anything similar, it may be important to check your byte order marks.