Upgrade to WCF 4.0 and my Singleton stopped working
I have a service decorated as a singleton. It is hosted in IIS on my Windows 7 development machine.
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)]
Prior to the upgrade I had migrated all my projects to use VS2010, but stayed in .NET 3.5; I had verified that everything was working correctly.
After I upgraded all of the projects to use .NET 4.0, my WCF service started behaving incorrectly. Each call to the WCF Service cre开发者_如何转开发ates a new object, which is clearly not how it is decorated (see above). I also upgraded the application pool to use 4.0 with an integrated pipeline (previously it was 2.0 with an integrated pipeline)
Has anyone experienced anything like this? I dont even know where to begin to troubleshoot this.
OK, I finally figured this out. We were using code the read the configuration, as well as created a compression channel based on code from Pablo Cibraro and Rodolfo Finochieti. Apparently, this code is not compatible with 4.0.
Once the compression and adhoc configuration reader code was removed, the problem went away.
精彩评论