Redis驱动ServiceStack.Redis 4.0以后开始商用,所以在各个地方做了限制:
查看官方说明,在 https://servicestack.net/download 页面的最下方。
Free Quotas
Whilst ServiceStack v4 is a commercially-supported product, we also allow free usage for small projects and evaluation purposes.
The NuGet packages above include the quota's below which can be unlocked with a license key:
- 10 Operations in ServiceStack (i.e. Request DTOs)
- 10 Tables in OrmLite
- 20 Different Types in JSON, JSV and CSV Serializers *
- 20 Different Types in Redis Client Typed APIs
- 6000 requests per hour with the Redis Client
* These quotas are lifted in ServiceStack.Client generic service clients allowing un-restricted access when consuming ServiceStack services.
之前项目里也遇到6000次限制问题,网上找了很久的解决方案,最终选择了降低版本到3.0
最近又有项目用到了,尝试下载了开源代码,网上也看了下限制修改方法。归纳以下两种破解方法:
1、最直接的,下载开源代码 GIthub地址:https://github.com/search?q=ServiceStack&type=Repositories
限制免费配额功能在ServiceStack.Text类库下的LicenseUtils.cs文件中,仅需从GitHub上下载源码后添加一行代码重新编译即可解除限制,如下图:
2