WCF Service class static constructor called in every call -
i have service class implementing contract follows:
interface icontractfoo { void foo(); } class servicefoo() : icontractfoo { public static servicefoo() { log("static constructor called"); } void foo() { log("foo called"); } }
what finiding each time foo api called, static constructor gets called. so, log looks -
static constructor called
foo called
static constructor called
foo called
this should not happening since static constructor. idea going wrong?
thanks help
by default, wcf services use "per-call" model. don't think marking constructor static
change behavior. can change using servicebehavior
attribute or changing servicebehavior settings in web.config file associated service.
here couple articles might decide model appropriate services:
Comments
Post a Comment