Is it related to IIS server settings? Application pool for example?
Or something is wrong with writing code?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
namespace SynergyWS
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
public class WebService1 : System.Web.Services.WebService
{
static WebService1()
{
//initialize
//write to log file
}
[WebMethod]
public string test()
{
return "0";
}
}
}
zionz
0 Points
14 Posts
My WebService static constructor getting called more then once
Dec 21, 2012 05:00 AM|LINK
Hi,
It is unlike normal behavior, how can I fix it?
Is it related to IIS server settings? Application pool for example?
Or something is wrong with writing code?
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; namespace SynergyWS { [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] public class WebService1 : System.Web.Services.WebService { static WebService1() { //initialize //write to log file } [WebMethod] public string test() { return "0"; } } }shanmugamm
Participant
1620 Points
321 Posts
Re: My WebService static constructor getting called more then once
Dec 21, 2012 05:06 AM|LINK
your service will behave differently based on the ServiceBehavior
Check this link
http://www.codeproject.com/Articles/86007/3-ways-to-do-WCF-instance-management-Per-call-Per
http://shanmugam-netguru.blogspot.com
Follow me in Linkedin
zionz
0 Points
14 Posts
Re: My WebService static constructor getting called more then once
Dec 21, 2012 05:22 AM|LINK
Hi,
I asked about asmx web service, not WCF.
Haixia Xie -...
Contributor
3085 Points
297 Posts
Microsoft
Re: My WebService static constructor getting called more then once
Dec 25, 2012 08:10 AM|LINK
Hi,
I do not reproduce your issue on my side, the static method is called just once. So do you try on other machines?
Best Regards.
Feedback to us
Develop and promote your apps in Windows Store