mvc shared Class Library

Go To


I have created a .net class library that is used to create reports from any of our projects. The situation is that I reference the class library dll in my mvc project. Than when a button is clicked I call a shared method within the class library as follows (PO is the namespace of my class library):

PO.GenerateReport(Parameter1, Parameter2, Parameter3, Parameter4, Parameter5, Parameter6, Parameter7)

This works great if one user is calling, as soon as more than one user tries to concurrently call PO.GenerateReport I start getting problems.

I would think each user instance would spin up their own instance of the PO class library but this isnt the case. Any ideas on how I can adapt this to the situation? Or am I totally wrong on how the class library is referenced or setup?

Thanks in advance

2012-04-03 21:11
by Matt


It looks like you've made the function static, which means no instance of the class is actually created. If you want it to be unique per user, you have to make the method non-static.

2012-04-03 21:15
by Erik Funkenbusch