2

I have a pretty simple library that implements the .Net Standard 2.0 as I need this library across a mix of frameworks (i.e, .Net Framework 4.7.2 applications).

At the most basic level the .Net Standard Library holds the class libraries and uses ServiceStack.OrmLite Sqlite to perform basic CRUD operations on a series of Sqlite databases , one separate database for each 'project' which is stored inside directories on various network drives. This is a requirement of the application to restrict access to information & store the client data inside the same project folder.

Here is the question: I've followed the instructions on https://docs.servicestack.net/register and placed the following code within the App.config of my test Console App - .Net Framework 4.7.2:

<appSettings>
    <add key="servicestack:license" value="{licenseKeyText}" />
</appSettings>

However, when I run my console application it triggers the following:

ServiceStack.LicenseException: 'The free-quota limit on '10 OrmLite Tables' has been reached. Please see https://servicestack.net to upgrade to a commercial license or visit https://github.com/ServiceStackV3/ServiceStackV3 to revert back to the free ServiceStack v3.'

This exception was originally thrown at this call stack:
    ServiceStack.LicenseUtils.ApprovedUsage(ServiceStack.LicenseFeature, ServiceStack.LicenseFeature, int, int, string) in LicenseUtils.cs
    ServiceStack.LicenseUtils.AssertValidUsage(ServiceStack.LicenseFeature, ServiceStack.QuotaType, int) in LicenseUtils.cs
    ServiceStack.OrmLite.OrmLiteConfigExtensions.GetModelDefinition(System.Type) in OrmLiteConfigExtensions.cs
    ServiceStack.OrmLite.OrmLiteWriteCommandExtensions.CreateTable(System.Data.IDbCommand, bool, System.Type) in OrmLiteWriteCommandExtensions.cs
    ServiceStack.OrmLite.OrmLiteWriteCommandExtensions.CreateTable<T>(System.Data.IDbCommand, bool) in OrmLiteWriteCommandExtensions.cs
    ServiceStack.OrmLite.OrmLiteSchemaApi.CreateTableIfNotExists.AnonymousMethod__15_0(System.Data.IDbCommand) in OrmLiteSchemaApi.cs
    ServiceStack.OrmLite.OrmLiteExecFilter.Exec<T>(System.Data.IDbConnection, System.Func<System.Data.IDbCommand, T>) in OrmLiteExecFilter.cs
    ServiceStack.OrmLite.OrmLiteReadExpressionsApi.Exec<T>(System.Data.IDbConnection, System.Func<System.Data.IDbCommand, T>) in OrmLiteReadExpressionsApi.cs
    ServiceStack.OrmLite.OrmLiteSchemaApi.CreateTableIfNotExists<T>(System.Data.IDbConnection) in OrmLiteSchemaApi.cs
...
    [Call Stack Truncated]

This should go without saying but I've obviously replaced the {licenseKeyText} with a Free Trial (30 Day) which is offered at https://servicestack.net/trial which will be replaced with a paid subscription once proof of concept is achieved with the OrmLite.

Is there something obvious that I am missing or does the ServiceStack.OrmLite require different registration process?

Thanks

JGeorge
  • 21
  • 1

1 Answers1

0

This error indicates that the License Key was not properly registered.

The issue is because your .NET Standard 2.0 project only references the .NET Core / .NET Standard build of ServiceStack libraries, in order to be compatible with .NET Framework your library project must multi-target and reference both .NET Framework and .NET Standard versions:

<PropertyGroup>
  <TargetFrameworks>net472;netstandard2.0</TargetFrameworks>
</PropertyGroup>

Then your .NET Framework Console App will be able to reference the .NET Framework v4.7.2 build of your library where it will be able to register the servicestack:license app setting in your .NET Framework Host project.

mythz
  • 141,670
  • 29
  • 246
  • 390