I'm trying to impersonate user identity between two WCF services (tcp.net).
When the client and the two services located on the same machine, everything work fine.
But when I move the services to a different machine than the client, it fails to pass the impersonated user identity to the second service (Client -> Server1 -> server2). I’m getting the following exception: “Either a required impersonation level was not provided, or the provided impersonation level is invalid”
Is it possible to do such a thing? what should be the configuration of the two servers?
I would like to create a custom attribute for my C# application which will decorate methods. So far no problems. But I noticed that the attirbute constructor being called only when I reflecting the attribute parameters. I would like that the attribute's constructor will be called every time I enter the method (like when decorate a class with an attribute and its contructor being called when creating an instance of the class). How can I do this?
I'm looking for something similar to PrincipalPermission attribute.
So when I enter the method I'll be able to do a certain check (permissions check) and throw an exception if needed.
How does it implemented in PrincipalPermission?
You will need to do this yourself when you enter the method. You need to use reflection to see if the method has the attribute and take the appropriate steps if it does or doesn't.
The functionality you describe isn't implemented in the attribute at all. It is implemented by the calling method. Keep in mind that some of this behavior is intrinsic to the .NET runtime itself and checking security permissions like this should be part of the runtime function calling behavior.
Scott. —In just two days, tomorrow will be yesterday.
I've done some googling, but haven't turned up any answers to my questions - can anyone help?
1) My application reads comma delimited records from a file. The read and split is very fast indeed, but after they've been read I need to create objects out of the records, do some validation etc. etc. This can take a while to complete for large record sets. Aha, says I, multiple threads can speed this up.
My plan is to have one thread read the file and then place the returned string array in to a queue. Then as many worker threads as needed can dequeue an individual array in the queue and go off to do its work.
First up - is this a sensible approach, or is it a real stinker of an idea and are there better ways to achieve the same?
2) Is dequeuing thread safe, or could two threads attempt to dequeue the same item in the queue?
3) Are there any guidlines on the number of threads one should spawn for a given processor type? My PC has a Quad Core in it, which I assume means that things really can happen concurrently. My users, however, may well be limited to single core processors which I think will mean that the threads will share processor time - could too many threads in this situation lead to much slower performance as they all vie for time?
Me: Can you see the "up" arrow?
Me: Can you see an arrow that points upwards?
User: Oh yes, I see it now!
-Excerpt from a support call taken by me, 08/31/2007
Even under conditions where it would it might be insignificant.
could too many threads in this situation lead to much slower performance as they all vie for time?
There are many issues that come into play like overhead for context switching and cache misses etc. Actually two threads could cause that to happen and unless yours is the only process running on a multi processor/core computer (very unlikely it is the only one) it may not get access to more than one core and could also result in reduced performance.
Multi-threading in a single user application is mostly (not always) applicable to keeping the UI from freezing during a long running process like graphics manipulation or interprocess communications, etc. Otherwise threads are mostly useful in a multi-user environment.
Last Visit: 31-Dec-99 18:00 Last Update: 2-Oct-23 18:13