C# SignalR within a class library - c#

I've been developing a Web Service (C# WebAPI2) so can simply send messages using SignalR and then store the message transcript within a TSQL database. However, after moving the SignalR hubs within a class library I can't seem to access them now. I have developed a very simply console application to communicate with the Web Service but I am getting a strange exception being thrown.
Here is the exception which is being thrown:
"StatusCode: 500, ReasonPhrase: 'Internal Server Error', Version: 1.1,
Content: System.Net.Http.StreamContent, Headers:\r\n{\r\n
Transfer-Encoding: chunked\r\n X-SourceFiles:
=?UTF-8?B?QzpcRGV2ZWxvcG1lbnRcU291cmNlQ29kZVxTVVBTZXJ2aWNlXFNVUC5TZXJ2aWNlXHNpZ25hbHJcbmVnb3RpYXRl?=\r\n
Cache-Control: private\r\n Date: Wed, 11 Mar 2015 10:50:18 GMT\r\n
Server: Microsoft-IIS/8.0\r\n X-AspNet-Version: 4.0.30319\r\n
X-Powered-By: ASP.NET\r\n Content-Type: text/html;
charset=utf-8\r\n}"
An unhandled exception of type 'System.AggregateException' occurred
in SignalR Client Connection.exe
The Owin Startup file is placed within the Web Service App_Start folder, here is what it looks like:
using System;
using System.Threading.Tasks;
using Microsoft.Owin;
using Owin;
using Microsoft.AspNet.SignalR;
[assembly: OwinStartup(typeof(Service.App_Start.Startup))]
namespace Service.App_Start
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.Map("/signalr", map =>
{
var hubConfiguration = new HubConfiguration
{
EnableDetailedErrors = true,
EnableJSONP = true
};
map.RunSignalR(hubConfiguration);
});
}
}
}
Many thanks.

I am not sure the details in your case, but for me I found that I was receiving the System.AggregationException:
System.AggregateException was unhandled
HResult=-2146233088
Message=One or more errors occurred.
Source=mscorlib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at Client.CommunicationHandler.AddMessage(String method, String args, String serverUri, String hubName) in c:\Workspace\EnvisionRealTimeRemoteOps\CodeProjectSelfHostedBroadcastServiceSignalRSample\Client\CommunicationHandler.cs:line 24
at Client.Program.Main(String[] args) in c:\Workspace\EnvisionRealTimeRemoteOps\CodeProjectSelfHostedBroadcastServiceSignalRSample\Client\Program.cs:line 15
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Net.Http.HttpRequestException
HResult=-2146233088
Message=An error occurred while sending the request.
InnerException: System.Net.WebException
HResult=-2146233079
Message=Unable to connect to the remote server
Source=System
StackTrace:
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
InnerException: System.Net.Sockets.SocketException
HResult=-2147467259
Message=No connection could be made because the target machine actively refused it 127.0.0.1:8083
Source=System
ErrorCode=10061
NativeErrorCode=10061
StackTrace:
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
InnerException:
Until I added a call to the following:
WebApp.Start("http://localhost:8083"); // Put your desired URL in...
Please note that in my case my application is using Self-Hosted SignalR.

Related

ObjectDisposedException SslStream and TcpClient

I am using a TcpClient with an SslStream. In general everything works fine but we are getting occasional logs of crashes. It seems to be coming from unstable network connections, and I'm unfortunately not able to reproduce it locally despite trying to create "unexpected circumstances":
using Fiddler to replicate a very slow network connection
killing the server application while its sending data
disconnecting network cables
The situation is this:
I call BeginRead like this:
_tcpClientStream.BeginRead(receiveBuffer, 0, receiveBuffer.Length, pfnCallBack, null);
And then EndRead is being called like this:
iRx = _tcpClientStream.EndRead(asyn);
The only place that the iRx is used is to copy the received data to a new array:
var bytes = new byte[iRx];
Array.Copy(receiveBuffer, bytes, iRx);
In the OnDataReceived callback function, I call EndRead on the SslStream, which throws an exception that is handled:
Error in OnDataReceived System.IO.IOException: The read operation failed, see inner exception. ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: size
at System.Net.Sockets.NetworkStream.BeginRead(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
at System.Net.FixedSizeReader.StartReading()
at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)
--- End of inner exception stack trace ---
at System.Net.Security._SslStream.EndRead(IAsyncResult asyncResult)
at System.Net.Security.SslStream.EndRead(IAsyncResult asyncResult)
at XXXXXXX.OnDataRecevied(IAsyncResult asyn)
Normally this is not a problem - this exception is caught and the TcpClient is closed and re-initiated to attempt to reconnect.
However, in this case there is a second Exception that is thrown and comes from one of the UnhandledException error handlers:
AppDomain.CurrentDomain.UnhandledException
Current.DispatcherUnhandledException
Current.Dispatcher.UnhandledException
TaskScheduler.UnobservedTaskException
This stack trace is like this:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.NetworkStream'.
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
Our handling for this type of unhandled error is to display a message to the user that there is a fatal error and the software has to close.
My questions are:
Has anyone ever seen this error before and been able to reproduce the exact out of range exception I'm getting? Despite my attempts to recreate the issue (using the methods described above), I'm not able to ever recreate the exception, it is always the more standard Socket IO exception:
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.Security._SslStream.EndRead(IAsyncResult asyncResult)
at System.Net.Security.SslStream.EndRead(IAsyncResult asyncResult)
at XXXXXXXXX.OnDataRecevied(IAsyncResult asyn)
Is there any way I can handle this exception in my Socket code or is it always going to appear in one of these UnhandledException events? If so, what is the best practice way of handling this? Basically I need some logic in the event handler to identify that the software should not shut down if this specific error is received?

Grapevine 3.1 - 'The process cannot access the file'

I have a solution that utilises Grapevine to start a server within the Program class.
For some reason though, as soon as I start the program, it crashes when server.Start() is called.
No other parts of the solution are running at this point, so I don't know how that could be happening?
Running in Visual Studio 15, as Administrator, on Windows 10.
Program.cs
using System;
using System.Threading;
using Grapevine.Server;
using QuantConnect.Logging;
namespace QuantConnect.Services
{
class Program
{
/// <summary>
/// QuantConnect C# Services Server:
/// </summary>
static void Main(string[] args)
{
var server = new RESTServer
{
//Host = Configuration.Config.Get("grapevine-host"),
//Port = Configuration.Config.Get("grapevine-port")
Host = Configuration.Config.Get("grapevine-host", "localhost"),
Port = Configuration.Config.Get("grapevine-port", "80")
};
Log.Trace(string.Format("Starting Server On {0}:{1}", server.Host, server.Port));
server.Start(); // Exception occurs here
while (server.IsListening)
{
Thread.Sleep(300);
}
Log.Trace("Server stopped. Press key to continue...");
Console.ReadLine();
}
}
}
Error and stacktrace:
An unhandled exception of type 'System.Net.HttpListenerException' occurred in Grapevine.dll
System.Net.HttpListenerException was unhandled
ErrorCode=32
HResult=-2147467259
Message=The process cannot access the file because it is being used by another process
NativeErrorCode=32
Source=System
StackTrace:
at System.Net.HttpListener.AddAllPrefixes()
at System.Net.HttpListener.Start()
at Grapevine.Server.RESTServer.Start()
at QuantConnect.Services.Program.Main(String[] args) in C:\Users\RichardsPC\Source\Repos\Lean\Services\Program.cs:line 29
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
So I figured out what the issue was.
I set Grapevine to use port 80.
Port = Configuration.Config.Get("grapevine-port", "80")
Issue was that there was another service on my machine using this port, I changed it to use 8080 and it works fine now.
Port = Configuration.Config.Get("grapevine-port", "8080")

Unhandled Aggregate Exception

I have followed the tutorial in ( http://www.c-sharpcorner.com/UploadFile/a6fd36/understand-self-host-of-a-web-apiC-Sharp/ ) and ( http://www.c-sharpcorner.com/uploadfile/a6fd36/understanding-how-to-call-the-web-api-from-a-client-applica/ ) but seem to still be getting System.AggregateException on
//Call HttpClient.GetAsync to send a GET request to the appropriate URI
HttpResponseMessage resp = client.GetAsync("api/books").Result;
and
var resp = client.GetAsync(string.Format("api/books/{0}", id)).Result;
and
var resp = client.GetAsync(query).Result;
The error states: An unhandled exception of type 'System.AggregateException' occurred in mscorlib.dll
Exception Detail -
System.AggregateException was unhandled
HResult=-2146233088
Message=One or more errors occurred.
Source=mscorlib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at TestClient.Program.ListAllBooks() in c:\Users\wa\Documents\Visual Studio 2013\Projects\SelfHost\TestClient\Program.cs:line 35
at TestClient.Program.Main(String[] args) in c:\Users\wa\Documents\Visual Studio 2013\Projects\SelfHost\TestClient\Program.cs:line 20
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Net.Http.HttpRequestException
HResult=-2146233088
Message=An error occurred while sending the request.
InnerException: System.Net.WebException
HResult=-2146233079
Message=Unable to connect to the remote server
Source=System
StackTrace:
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
InnerException: System.Net.Sockets.SocketException
HResult=-2147467259
Message=No connection could be made because the target machine actively refused it [::1]:8080
Source=System
ErrorCode=10061
NativeErrorCode=10061
StackTrace:
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
InnerException:
Any Ideas?
Thank You
Please read the last line :)
InnerException: System.Net.WebException
HResult=-2146233079
Message=Unable to connect to the remote server

SignalR .NET client throws TimeoutException on first time connection attempt

I have two console applications:
First one is self hosted ASP.NET WebApi application containing SignalR v2
Second application acts as SignalR client
Following code demonstrates how I initialize SignalR server:
public void Configuration(IAppBuilder app)
{
HttpConfiguration webApiConfiguration = ConfigureWebApi();
app.UseWebApi(webApiConfiguration);
app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);
app.MapSignalR(new HubConfiguration() { EnableDetailedErrors = true });
}
And this is how I am trying to establish connection with the server from the client application:
public void Run()
{
HubConnection hubConnection = new HubConnection(this.hubConnectionURL);
hubConnection.TraceLevel = TraceLevels.All;
hubConnection.TraceWriter = Console.Out;
remoteServerHubProxy = hubConnection.CreateHubProxy("SignalRHub");
remoteServerHubProxy.On<Int32, MyModel>("MethodName", new Action<Int32, MyModel>((lid, model) => this.MethodName(lid, model)));
hubConnection.Start().Wait();
}
Whenever Start().Wait() executes, following exception happens clientside:
System.AggregateException was unhandled
HResult=-2146233088
Message=One or more errors occurred.
Source=mscorlib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
...
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.TimeoutException
HResult=-2146233083
Message=Transport timed out trying to connect
InnerException:
The interesting part is, that this exception happens only during first ever connection attemp from the client (first connection attempt after server app restart, thats it). If I restart the client or launch another client instance, then it connects fine and SignalR communication works smoothly.
Anyone knows what I am doing wrong here?
I am also attaching SignalR logs both from server and client.
Server log:
SignalR.PerformanceCounterManager Error: 0 : Performance counter failed to load:
System.InvalidOperationException: The requested Performance Counter is not a cu
stom counter, it has to be initialized as ReadOnly.
at System.Diagnostics.PerformanceCounter.InitializeImpl()
at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String co
unterName, String instanceName, Boolean readOnly)
at Microsoft.AspNet.SignalR.Infrastructure.PerformanceCounterManager.LoadCoun
ter(String categoryName, String counterName, String instanceName, Boolean isRead
Only)
-- Client attempts to connect at this point --
SignalR.ReflectedHubDescriptorProvider Warning: 0 : Some of the classes from ass
embly "System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf
3856ad364e35" could Not be loaded when searching for Hubs. [C:\WINDOWS\Microsoft
.Net\assembly\GAC_MSIL\System.Web.Helpers\v4.0_2.0.0.0__31bf3856ad364e35\System.
Web.Helpers.dll]
Original exception type: ReflectionTypeLoadException
Original exception message: Unable to load one or more of the requested types. R
etrieve the LoaderExceptions property for more information.
Client log:
12:03:07.1550299 - null - ChangeState(Disconnected, Connecting)
12:03:10.8516530 - 51a4e258-e99d-4cb3-ae14-6db438b38f95 - WS Connecting to: ws:/
/localhost:50439/signalr/connect?clientProtocol=1.4&transport=webSockets&connect
ionData=[{"Name":"SignalRHub"}]&connectionToken=AQAAANCMnd8BFdERjHoAwE%2FCl%2BsB
AAAAnx4jsfsOuUa3e0rrW2DifQAAAAACAAAAAAAQZgAAAAEAACAAAAA1tTgi2Va0M73SCNJ9d0%2FKsU
IxJ2aa2MrFGOPAWa7ToAAAAAAOgAAAAAIAACAAAABDorXWYymqxI%2BWurCF6ugPmi7YtifHOo9mqJNF
m2Cw8DAAAACgotOAC75ljMQHhlhFOUsrU4DQBJJ0HvVDP1VGDNfIc9onQ8niU3cmFHA%2BnUHsVExAAA
AAsdFd7ZtqMuHBBl%2FuT%2Bg0hDG5OWmEeJKDZWvkHuOPUHXUVM2S0fTRsDW1BdOg4bai4w3LvbYqqK
dYFqdY8KimvA%3D%3D
12:03:15.9569154 - 51a4e258-e99d-4cb3-ae14-6db438b38f95 - Auto: Failed to connec
t to using transport webSockets. System.TimeoutException: Transport timed out tr
ying to connect
12:03:15.9569154 - 51a4e258-e99d-4cb3-ae14-6db438b38f95 - SSE: GET http://localh
ost:50439/signalr/connect?clientProtocol=1.4&transport=serverSentEvents&connecti
onData=[{"Name":"SignalRHub"}]&connectionToken=AQAAANCMnd8BFdERjHoAwE%2FCl%2BsBA
AAAnx4jsfsOuUa3e0rrW2DifQAAAAACAAAAAAAQZgAAAAEAACAAAAA1tTgi2Va0M73SCNJ9d0%2FKsUI
xJ2aa2MrFGOPAWa7ToAAAAAAOgAAAAAIAACAAAABDorXWYymqxI%2BWurCF6ugPmi7YtifHOo9mqJNFm
2Cw8DAAAACgotOAC75ljMQHhlhFOUsrU4DQBJJ0HvVDP1VGDNfIc9onQ8niU3cmFHA%2BnUHsVExAAAA
AsdFd7ZtqMuHBBl%2FuT%2Bg0hDG5OWmEeJKDZWvkHuOPUHXUVM2S0fTRsDW1BdOg4bai4w3LvbYqqKd
YFqdY8KimvA%3D%3D
12:03:20.9764573 - 51a4e258-e99d-4cb3-ae14-6db438b38f95 - Auto: Failed to connec
t to using transport serverSentEvents. System.TimeoutException: Transport timed
out trying to connect
12:03:20.9764573 - 51a4e258-e99d-4cb3-ae14-6db438b38f95 - LP Connect: http://loc
alhost:50439/signalr/connect?clientProtocol=1.4&transport=longPolling&connection
Data=[{"Name":"SignalRHub"}]&connectionToken=AQAAANCMnd8BFdERjHoAwE%2FCl%2BsBAAA
Anx4jsfsOuUa3e0rrW2DifQAAAAACAAAAAAAQZgAAAAEAACAAAAA1tTgi2Va0M73SCNJ9d0%2FKsUIxJ
2aa2MrFGOPAWa7ToAAAAAAOgAAAAAIAACAAAABDorXWYymqxI%2BWurCF6ugPmi7YtifHOo9mqJNFm2C
w8DAAAACgotOAC75ljMQHhlhFOUsrU4DQBJJ0HvVDP1VGDNfIc9onQ8niU3cmFHA%2BnUHsVExAAAAAs
dFd7ZtqMuHBBl%2FuT%2Bg0hDG5OWmEeJKDZWvkHuOPUHXUVM2S0fTRsDW1BdOg4bai4w3LvbYqqKdYF
qdY8KimvA%3D%3D
12:03:25.9915200 - 51a4e258-e99d-4cb3-ae14-6db438b38f95 - Auto: Failed to connec
t to using transport longPolling. System.TimeoutException: Transport timed out t
rying to connect
12:03:25.9965215 - 51a4e258-e99d-4cb3-ae14-6db438b38f95 - Disconnected
12:03:25.9965215 - 51a4e258-e99d-4cb3-ae14-6db438b38f95 - Transport.Dispose(51a4
e258-e99d-4cb3-ae14-6db438b38f95)
12:03:25.9965215 - 51a4e258-e99d-4cb3-ae14-6db438b38f95 - Closed
The problem was with the library System.Web.Helpers which is part of ASP.NET MVC installation. As soon as I set the CopyLocal=true for this specific assembly in the References, my problem went away.

Getting ProtocolException with running DotNetOpenAuth sample

I have downloaded DotNetOpenAuth-3.4.6.10357 built it (had to exclude OpenIdOfflineProvider because of build errors) and run OAuthConsumerWpf. After clicking Authorize I got the exception below. Please bear in mind I modified app.config as instructed. This is from the Google tab. I also tried Generic tab with the same results.
What could be wrong here? Shouldn't things as simple as this work out of the box?
DotNetOpenAuth.Messaging.ProtocolException was unhandled
Message=Error occurred while sending a direct message or getting the response.
Source=DotNetOpenAuth
StackTrace:
at DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetResponse(HttpWebRequest request, DirectWebRequestOptions options) in c:\Users\andarno\git\dotnetopenid\src\DotNetOpenAuth\Messaging\StandardWebRequestHandler.cs:line 172
at DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetResponse(HttpWebRequest request) in c:\Users\andarno\git\dotnetopenid\src\DotNetOpenAuth\Messaging\StandardWebRequestHandler.cs:line 100
at DotNetOpenAuth.Messaging.Channel.GetDirectResponse(HttpWebRequest webRequest) in c:\Users\andarno\git\dotnetopenid\src\DotNetOpenAuth\Messaging\Channel.cs:line 607
at DotNetOpenAuth.Messaging.Channel.RequestCore(IDirectedProtocolMessage request) in c:\Users\andarno\git\dotnetopenid\src\DotNetOpenAuth\Messaging\Channel.cs:line 628
at DotNetOpenAuth.Messaging.Channel.Request(IDirectedProtocolMessage requestMessage) in c:\Users\andarno\git\dotnetopenid\src\DotNetOpenAuth\Messaging\Channel.cs:line 451
at DotNetOpenAuth.Messaging.Channel.Request[TResponse](IDirectedProtocolMessage requestMessage) in c:\Users\andarno\git\dotnetopenid\src\DotNetOpenAuth\Messaging\Channel.cs:line 431
at DotNetOpenAuth.OAuth.ConsumerBase.PrepareRequestUserAuthorization(Uri callback, IDictionary`2 requestParameters, IDictionary`2 redirectParameters, String& requestToken) in c:\Users\andarno\git\dotnetopenid\src\DotNetOpenAuth\OAuth\ConsumerBase.cs:line 222
at DotNetOpenAuth.OAuth.DesktopConsumer.RequestUserAuthorization(IDictionary`2 requestParameters, IDictionary`2 redirectParameters, String& requestToken) in c:\Users\andarno\git\dotnetopenid\src\DotNetOpenAuth\OAuth\DesktopConsumer.cs:line 42
at DotNetOpenAuth.ApplicationBlock.GoogleConsumer.RequestAuthorization(DesktopConsumer consumer, Applications requestedAccessScope, String& requestToken) in C:\Users\user\Desktop\DotNetOpenAuth-3.4.6.10357\Samples\DotNetOpenAuth.ApplicationBlock\GoogleConsumer.cs:line 204
at DotNetOpenAuth.Samples.OAuthConsumerWpf.MainWindow.<beginAuthorizationButton_Click>b__3(DesktopConsumer consumer, String& requestToken) in C:\Users\user\Desktop\DotNetOpenAuth-3.4.6.10357\Samples\OAuthConsumerWpf\MainWindow.xaml.cs:line 92
at DotNetOpenAuth.Samples.OAuthConsumerWpf.Authorize.<>c__DisplayClass4.<.ctor>b__0(Object state) in C:\Users\user\Desktop\DotNetOpenAuth-3.4.6.10357\Samples\OAuthConsumerWpf\Authorize.xaml.cs:line 33
at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)
InnerException: System.Net.WebException
Message=The remote server returned an error: (400) Bad Request.
Source=System
StackTrace:
at System.Net.HttpWebRequest.GetResponse()
at DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetResponse(HttpWebRequest request, DirectWebRequestOptions options) in c:\Users\andarno\git\dotnetopenid\src\DotNetOpenAuth\Messaging\StandardWebRequestHandler.cs:line 126
InnerException:
Works for me. Perhaps your computer is behind a firewall or needs a proxy server registered?

Categories

Resources