Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LonelyLonely12 opened this issue Aug 10, 2022 · 0 comments

Comments

@LonelyLonely12
Copy link

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 ShoppingCartList = new List();
var storage = new LocalStorage();-----------(1)
storage.Store(uuid , ShoppingCartList );
storage.Persist();

ShoppingCartList = storage.Get<List>(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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant