localstorage icon indicating copy to clipboard operation
localstorage copied to clipboard

LocalStorage for .net is NULL and The process cannot access because it is being used by another process.

Open LonelyLonely12 opened this issue 2 years ago • 0 comments

I have some problem When multiple users will encounter this problem.

My Controller : When the user enters for the first time

public class ShoppingCart { public string ProductID { get; set; } public string Amount { get; set; } }

public ActionResult Index() { var uuid = Guid.NewGuid().ToString(); List<ShoppingCart> ShoppingCartList = new List<ShoppingCart>(); var storage = new LocalStorage();-----------(1) storage.Store(uuid , ShoppingCartList ); storage.Persist();

ShoppingCartList = storage.Get<List<ShoppingCart>>(uuid); -----------(2) int Amount = ShoppingCartList.Count; return View(); }

line --(1) error : System.IO.IOException: The process cannot access the file 'C:\xxx\yyy\zzz\ .localstorage' because it is being used by another process.

line --(2) error : System.NullReferenceException: Object reference not set to an instance of an object.

Both errors are not always present. Where am I going wrong?

LonelyLonely12 avatar Aug 10 '22 10:08 LonelyLonely12