开发者

Validating ASP.Net Custom MembershipUser over WCF Causing Unsolicited Service Calls?

开发者 https://www.devze.com 2023-01-08 02:22 出处:网络
Okay,...first the facts. I\'m working on an ASP.Net project which validates it\'s users across a WCF service.I have a CutomMembershipUser class in a shared assembly which inherits from MembershipUser

Okay,...first the facts.

I'm working on an ASP.Net project which validates it's users across a WCF service. I have a CutomMembershipUser class in a shared assembly which inherits from MembershipUser since I'm using a custom membership provider. All this cannot change because it's out of my remit.

Here's roughly what's happening. I've got some code in the Logged_In event of a login control that looks like this...

            CustomMembershipUser user = (CustomMembershipUser)SecurityBL.GetUser(userName);

            if (user.Customer.ToLower() == "some user")
            {
                //impl omitted
            }

The first line executes without problems and I get the correct user back from the service. However, in the second line, when I compare the user.Customer property a second request is sent to the service with an empty userName string which hangs the whole IDE for about 30 secnods or so and eventually throws a FaultException<T> which I can catch on the service side.

Obviously my first assumption was that there was some logic in the getter of that property that lazy loads the property but there isn't; in fact it's an auto implemented property!

Even more strange than that,..in the calling code I can't even catch the exception which tells me that the request is coming from a different thread than that which I'm executing.

This same problem happens for any property access on this object whether it's overridden or entirely new.

Has anyone seen anything like this before? I'v been scratching my head for 2 days no开发者_Python百科w and I'm not sure what to try next.

Any help would be great.

Thanks in advance. Stimul8d


membership is pretty straight ahead and actually has no knowledge of network communications especially not WCF,, so there has to be something hinky happening in your code. really.

if you want to try and isolate the smallest footprint of code that reproduces the effect and upload it somewhere I would be happy to take a look.

0

精彩评论

暂无评论...
验证码 换一张
取 消