When compiling this project , same Error occurred.

Sep 20, 2010 at 8:05 AM

Error 2 "System.Data.Services.Client.SendingRequestEventArgs" does not include "RequestHeaders" definition, and can not find an acceptable type "System.Data.Services.Client.SendingRequestEventArgs" first parameter of extension methods "RequestHeaders" (are you missing a using directive or an assembly reference?) C: \ ******* \ Thinktecture.IdentityModel \ Web \ FederatedWebClientExtensions.cs 92 19 Thinktecture.IdentityModel

Can anyone Help me?

Sep 20, 2010 at 8:08 AM

        /// <summary>
        /// Sets the access token on a WCF Data Services client.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="token">The token.</param>
        /// <param name="type">The type.</param>
        /// <param name="headerName">Name of the header.</param>
        public static void SetAccessToken(this DataServiceContext context, string token, string type, string headerName)
        {
            context.SendingRequest += (s, e) =>
            {
                e.RequestHeaders[headerName] = GetHeader(token, type);
            };
        }

The Error occurred on the line above ,which is colored red.

Jan 7, 2011 at 3:41 PM

Same error here. I had to make the following change to get it to build in VS2008:

 

 context.SendingRequest += (s, e) =>            

{                

//e.RequestHeaders[headerName] = GetHeader(token, type);                

e.Request.Headers[headerName] = GetHeader(token, type);          

 };