junian / Standard.Licensing

Easy-to-use licensing library for .NET Framework, Mono, .NET Core, and MAUI / Xamarin products
https://junian.dev/Standard.Licensing/
MIT License
535 stars 120 forks source link

System.Xml.XmlException: 'Data at the root level is invalid. Line 1, position 1.' #19

Open alejo9010 opened 3 years ago

alejo9010 commented 3 years ago

anyone knows how to fix this issue please? im triying the default license generator from the guide, but im getting this in my app.

itsjoshsmith commented 2 years ago

The load function seems to want the XML string rather than the file path, its not very clear in the docs. See code below;

using System.IO;

string xml = File.ReadAllText("License.lic"); var license = License.Load(xml);

That should work.