casbin / Casbin.NET

An authorization library that supports access control models like ACL, RBAC, ABAC in .NET (C#)
https://casbin.org
Apache License 2.0
1.16k stars 111 forks source link

InvalidOperationException: Collection was modified #244

Closed martinbolco closed 8 months ago

martinbolco commented 2 years ago

Hi All,

by looking at our logs we noticed repeating issues with collections being modified in couple of methods inside Casbin.NET library. See please the screenshots from the logs:

image

image

Can somebody please take a look at it?

Thank you,

Martin

casbin-bot commented 2 years ago

@sagilio @xcaptain @huazhikui

sagilio commented 2 years ago

The model at Casbin.NET v1 is not thread-safe default, please make sure synchronous call model instance.

You can try to use SyncedEnforcer.Create() to create an enforcer instance at Casbin.NET v2.

martinbolco commented 2 years ago

Thank you for the info. As I can see v2 is still in the preview. When do you plan to release standard version?

hsluoyz commented 8 months ago

@martinbolco v2 has been released, latest is v2.1.1: https://github.com/casbin/Casbin.NET/releases