{"record":{"id":"141ac3a772a0ffa9","repo":"bchavez/Bogus","slug":"a-premium-license-is-required-to-use-this-api-ple","errorCode":null,"errorMessage":"A premium license is required to use this API. Please double check that your '{LicenseVerifier.LicenseFile}' file exists in the same folder as Bogus.dll. Also, you can add additional probing paths for the license file in {nameof(LicenseVerifier)}.{nameof(LicenseVerifier.ProbePaths)}. Lastly, you can set the following static properties manually: {nameof(Bogus)}.{nameof(License)}.{nameof(License.LicenseTo)} and {nameof(Bogus)}.{nameof(License)}.{nameof(License.LicenseKey)}. For more information, please visit: https://github.com/bchavez/Bogus/wiki/Bogus-Premium","messagePattern":"A premium license is required to use this API\\. Please double check that your '(.+?)' file exists in the same folder as Bogus\\.dll\\. Also, you can add additional probing paths for the license file in (.+?)\\.(.+?)\\. Lastly, you can set the following static properties manually: (.+?)\\.(.+?)\\.(.+?) and (.+?)\\.(.+?)\\.(.+?)\\. For more information, please visit: https://github\\.com/bchavez/Bogus/wiki/Bogus-Premium","errorType":"exception","errorClass":"BogusException","httpStatus":null,"severity":"critical","filePath":"Source/Bogus/Premium/PremiumDataSet.cs","lineNumber":52,"sourceCode":"          string.IsNullOrWhiteSpace(License.LicenseKey))\n      {\n         var path = LicenseVerifier.FindLicense();\n         if( path != null )\n         {\n            LicenseVerifier.ReadLicense(path, out var licenseTo, out var licenseKey);\n            License.LicenseTo = licenseTo;\n            License.LicenseKey = licenseKey;\n         }\n      }\n      if( !string.IsNullOrWhiteSpace(License.LicenseTo) &&\n          !string.IsNullOrWhiteSpace(License.LicenseKey) &&\n          LicenseVerifier.VerifyLicense(License.LicenseTo, License.LicenseKey) )\n      {\n         this.Initialize();\n         return;\n      }\n\n      throw new BogusException(\n         \"A premium license is required to use this API. \" +\n         $\"Please double check that your '{LicenseVerifier.LicenseFile}' file exists in the same folder as Bogus.dll. \" +\n         $\"Also, you can add additional probing paths for the license file in {nameof(LicenseVerifier)}.{nameof(LicenseVerifier.ProbePaths)}. \" +\n         $\"Lastly, you can set the following static properties manually: \" +\n         $\"{nameof(Bogus)}.{nameof(License)}.{nameof(License.LicenseTo)} and \" +\n         $\"{nameof(Bogus)}.{nameof(License)}.{nameof(License.LicenseKey)}. \"+\n         \"For more information, please visit: https://github.com/bchavez/Bogus/wiki/Bogus-Premium\");\n   }\n\n\n   protected abstract void Initialize();\n\n   protected void LoadResource(Assembly asm, string resourceName)\n   {\n      var obj = ResourceHelper.ReadBObjectResource(asm, resourceName);\n      //patch\n      var enLocale = Database.GetLocale(\"en\");\n","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/bchavez/Bogus/blob/6ece18c5c22648ab4606e45a0aaf2f07fc5259e4/Source/Bogus/Premium/PremiumDataSet.cs#L34-L70","documentation":"Thrown by PremiumDataSet when no valid premium license is found. The constructor checks License.LicenseTo/LicenseKey and LicenseVerifier.VerifyLicense; if verification fails it raises a BogusException listing the probing paths and wiki link. Premium data sets (extended locales/features) require a paid license.","triggerScenarios":"Instantiating any PremiumDataSet subclass (e.g. premium locale data) without a valid license file next to Bogus.dll or without manually setting License.LicenseTo/LicenseKey.","commonSituations":"Using premium-only API surface in CI/deployment where the license file is missing, or after a Bogus upgrade that changed license probing. License file not copied to output directory.","solutions":["Obtain a premium license and place the license file in the same folder as Bogus.dll (set to copy to output).","Add the license folder to LicenseVerifier.ProbePaths at startup.","Manually set Bogus.License.LicenseTo and Bogus.License.LicenseKey in code before instantiating premium datasets.","If premium is not intended, stop using the premium-only API and use the free dataset equivalents."],"exampleFix":"// before\nvar data = new SomePremiumDataSet();\n// after\nBogus.License.LicenseTo = \"MyCo\";\nBogus.License.LicenseKey = \"...\";\nvar data = new SomePremiumDataSet();","handlingStrategy":"validation","validationCode":"// verify license presence before touching premium APIs\nif (!LicenseVerifier.VerifyLicense(Bogus.License.LicenseTo, Bogus.License.LicenseKey))\n    throw new InvalidOperationException(\"Premium license missing or invalid\");","typeGuard":null,"tryCatchPattern":"try { var ds = new SomePremiumDataSet(); }\ncatch (BogusException ex) when (ex.Message.Contains(\"premium license\")) {\n    // load license from vault/secrets and set License.LicenseTo/Key, then retry or disable feature\n}","preventionTips":["Set License.LicenseTo/Key at application startup from a secret store.","Copy the license file to the output directory in your .csproj.","Add a startup health check that calls LicenseVerifier.VerifyLicense."],"tags":["bogus","premium","license","configuration"],"backgroundTag":null,"analyzedSha":"6ece18c5c22648ab4606e45a0aaf2f07fc5259e4","analyzedAt":"2026-08-13T21:08:15.463Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}