401 Unauthorized

Jul 25, 2008 at 7:22 PM
I am getting 401 Unauthorized error from silverlight server.
Although able to login manually to the site and set those information in my web.config.
(I am using VS2008, SL2beta2)

Line
System

.Net.HttpWebResponse response = request.GetResponse() as HttpWebResponse;
under 
SilverlightStreamingHost.cs
returns error.

I tried another solution :
NetworkCredential userCredential = new NetworkCredential(ACCOUNTID, KEY, http://silverlight.services.live.com);
CredentialCache credentials = new CredentialCache();
credentials.Add(new System.Uri("http://silverlight.services.live.com"), "Basic ", userCredential);
request.Credentials = credentials;

instead of :
byte[] userPass = System.Text.Encoding.Default.GetBytes(ACCOUNTID + ":" + KEY);
string basic = "Basic " + Convert.ToBase64String(userPass);
request.Headers["Authorization"] = basic;

but didnt work.

What am I missing ?