My Server (System.Net) is working on my local mashine (win10), but not on the ubuntu server, i get this error:
Unhandled exception. System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'size')
at System.Net.Sockets.NetworkStream.BeginRead(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
at Server.Client.Start() in C:\Users\xxxx\source\repos\Server\Server\Client.cs:line 28
at Server.ClientManager.CreateNewConnection(TcpClient tempClient) in C:\Users\xxxx\source\repos\Server\Server\ClientManager.cs:line 19
at Server.Server.OnClientConnect(IAsyncResult result) in C:\Users\xxxx\source\repos\Server\Server\Server.cs:line 61
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback()
at System.Net.ContextAwareResult.<>c.<Complete>b__15_0(Object s)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
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.CompletionCallback(Int32 numBytes, SocketError errorCode)
at System.Net.Sockets.AcceptOverlappedAsyncResult.CompletionCallback(IntPtr acceptedFileDescriptor, Byte[] socketAddress, Int32 socketAddressLen, SocketError errorCode)
at System.Net.Sockets.SocketAsyncContext.AcceptOperation.InvokeCallback(Boolean allowPooling)
at System.Net.Sockets.SocketAsyncContext.OperationQueue`1.ProcessAsyncOperation(TOperation op)
at System.Net.Sockets.SocketAsyncContext.ReadOperation.System.Threading.IThreadPoolWorkItem.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Aborted (core dumped)
this is the code thats causing the error (its working on my local):
socket.SendBufferSize = 4096;
socket.ReceiveBufferSize = 4096;
stream = socket.GetStream();
recBuffer = new byte[4096];
stream.BeginRead(recBuffer, 0, socket.ReceiveBufferSize, OnReceiveData, null);
Console.WriteLine($"Connection from {socket.Client.RemoteEndPoint.ToString()}");
when i listen with netcat to the port im using (55555) and connect in the game, the connection works, so i think the port/firewall is fine.
i tried exporting it as a linux build, and as a windows build, which i executed via wine, both didn't work.
this is how i published it:
publish
Related
We have a WPF client that connects with SignalR to one of our servers. When closing the WPF client we also close the SignalR HubConnection:
public HubConnection Connection => _connection ??= GetConnection();
private HubConnection GetConnection()
{
var host = ConfigurationManager.AppSettings["SignalRHost"];
var connection = new HubConnectionBuilder()
.WithUrl(host)
.Build();
connection.Closed += ConnectionOnClosed;
return connection;
}
private async Task ConnectionOnClosed(Exception exception)
{
// The connection is disconnected
if (_disconnecting)
{
// The disconnect was requested by the client
Connection.Closed -= ConnectionOnClosed;
Logger.Information("The connection to SignalR hub was closed.");
}
else
{
await StartAsync();
}
}
public async Task Disconnect()
{
if (_disconnecting) return;
try
{
_disconnecting = true;
await _connection.StopAsync();
}
catch (Exception e)
{
Logger.Error(e, "Error in closing connection");
}
finally
{
await _connection.DisposeAsync();
_connection = null;
}
}
Calling CloseAsync results in two ObjectDisposedExceptions. I only have a partial stacktrace (that seems to be another problem in my VS):
System.dll!System.Net.Sockets.NetworkStream.InternalSocket.get() Line 136
System.dll!System.Net.PooledStream.CancelPendingIoAndCloseIfSafe(bool closeWithTimeout, int timeout) Line 596
System.dll!System.Net.PooledStream.Close(int timeout) Line 682
System.dll!System.Net.Connection.AbortOrDisassociate(System.Net.HttpWebRequest request, System.Net.WebException webException) Line 2859
System.dll!System.Net.HttpWebRequest.Abort(System.Exception exception, int abortState) Line 3173
System.dll!System.Net.HttpWebRequest.Abort() Line 3133
System.dll!System.Net.WebSockets.ClientWebSocket.AbortRequest(object obj) Line 366
mscorlib.dll!System.Threading.CancellationCallbackInfo.ExecutionContextCallback(object obj) Line 1031
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Line 917
mscorlib.dll!System.Threading.CancellationCallbackInfo.ExecuteCallback() Line 1021
mscorlib.dll!System.Threading.CancellationTokenSource.CancellationCallbackCoreWork(System.Threading.CancellationCallbackCoreWorkArguments args) Line 863
mscorlib.dll!System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(bool throwOnFirstException) Line 808
mscorlib.dll!System.Threading.CancellationTokenSource.NotifyCancellation(bool throwOnFirstException) Line 743
System.dll!System.Net.WebSockets.ClientWebSocket.Dispose() Line 377
System.dll!System.Net.WebSockets.ClientWebSocket.Abort() Line 360
Microsoft.AspNetCore.Http.Connections.Client.dll!Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport.ProcessSocketAsync(System.Net.WebSockets.WebSocket socket) Line 220
And the next:
> System.dll!System.Net.Sockets.NetworkStream.InternalSocket.get() Line 136 C#
System.dll!System.Net.PooledStream.CancelPendingIoAndCloseIfSafe(bool closeWithTimeout, int timeout) Line 596 C#
System.dll!System.Net.PooledStream.Close(int timeout) Line 682 C#
System.dll!System.Net.Connection.AbortSocket(bool isAbortState) Line 2901 C#
System.dll!System.Net.ConnectStream.CloseInternal(bool internalCall, bool aborting) Line 2707 C#
System.dll!System.Net.ConnectStream.System.Net.ICloseEx.CloseEx(System.Net.CloseExState closeState) Line 2426 C#
System.dll!System.Net.HttpWebResponse.Abort() Line 479 C#
System.dll!System.Net.HttpWebRequest.SetResponse(System.Exception E) Line 3968 C#
System.dll!System.Net.HttpWebRequest.SetAndOrProcessResponse(object responseOrException) Line 3661 C#
System.dll!System.Net.ConnectionReturnResult.SetResponses(System.Net.ConnectionReturnResult returnResult) Line 205 C#
System.dll!System.Net.Connection.AbortOrDisassociate(System.Net.HttpWebRequest request, System.Net.WebException webException) Line 2873 C#
System.dll!System.Net.HttpWebRequest.Abort(System.Exception exception, int abortState) Line 3173 C#
System.dll!System.Net.HttpWebRequest.Abort() Line 3133 C#
System.Net.Http.dll!System.Net.Http.HttpClientHandler.OnCancel(object state) Line 1210 C#
mscorlib.dll!System.Threading.CancellationCallbackInfo.ExecutionContextCallback(object obj) Line 1031 C#
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980 C#
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928 C#
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Line 917 C#
mscorlib.dll!System.Threading.CancellationCallbackInfo.ExecuteCallback() Line 1021 C#
mscorlib.dll!System.Threading.CancellationTokenSource.CancellationCallbackCoreWork(System.Threading.CancellationCallbackCoreWorkArguments args) Line 863 C#
mscorlib.dll!System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(bool throwOnFirstException) Line 808 C#
mscorlib.dll!System.Threading.CancellationTokenSource.NotifyCancellation(bool throwOnFirstException) Line 743 C#
mscorlib.dll!System.Threading.CancellationTokenSource.LinkedTokenCancelDelegate(object source) Line 91 C#
mscorlib.dll!System.Threading.CancellationCallbackInfo.ExecutionContextCallback(object obj) Line 1031 C#
mscorlib.dll!System.Threading.CancellationCallbackInfo.ExecuteCallback() Line 1021 C#
mscorlib.dll!System.Threading.CancellationTokenSource.CancellationCallbackCoreWork(System.Threading.CancellationCallbackCoreWorkArguments args) Line 863 C#
mscorlib.dll!System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(bool throwOnFirstException) Line 808 C#
mscorlib.dll!System.Threading.CancellationTokenSource.NotifyCancellation(bool throwOnFirstException) Line 743 C#
mscorlib.dll!System.Threading.CancellationTokenSource.TimerCallbackLogic(object obj) Line 534 C#
mscorlib.dll!System.Threading.TimerQueueTimer.CallCallbackInContext(object state) Line 730 C#
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 980 C#
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 928 C#
mscorlib.dll!System.Threading.TimerQueueTimer.CallCallback() Line 713 C#
mscorlib.dll!System.Threading.TimerQueueTimer.Fire() Line 670 C#
mscorlib.dll!System.Threading.TimerQueue.FireQueuedTimerCompletion(object state) Line 444 C#
mscorlib.dll!System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() Line 1252 C#
mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch() Line 820 C#
mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() Line 1161 C#
The server is running in Visual Studio at http://localhost:5008/tubahub. When running the server in IIS on the same machine we also get a SocketException when calling StopAsync due to a timeout. Perhaps that is related.
I need a method that attempts to connect to the server until it successfully connects. I've done so successfully with Socket.Connect but I can't get it to work with Socket.BeginConnect.
This is the method:
public void Start()
{
while (clientSocket == null || !clientSocket.Connected)
{
try
{
clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
clientSocket.BeginConnect(serverEndPoint, new AsyncCallback(ConnectCallback), null);
}
catch (SocketException)
{
clientSocket.Close();
Start();
}
catch (Exception) { throw; }
}
}
private void ConnectCallback(IAsyncResult ar)
{
try
{
clientSocket.EndConnect(ar);
clientSocket.BeginReceive(buffer, 0, buffer.Length, SocketFlags.None, new AsyncCallback(ReceiveCallback), null);
}
catch (Exception) { throw; }
}
But I get this error (multiple times):
System.ArgumentException: The IAsyncResult object was not returned
from the corresponding asynchronous method on this class. Parameter
name: asyncResult at
System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) at
SocketLibrary.Client.TCPClient.ConnectCallback(IAsyncResult ar) 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.Socket.ConnectCallback() at
System.Net.Sockets.Socket.RegisteredWaitCallback(Object state, Boolean
timedOut) at
System.Threading._ThreadPoolWaitOrTimerCallback.PerformWaitOrTimerCallback(Object
state, Boolean timedOut)
I tried catching the ArgumentException but then I got this error (multiple times again)
Unhandled Exception: System.NullReferenceException: Object reference
not set to an instance of an object. at
SocketLibrary.Client.TCPClient.ConnectCallback(IAsyncResult ar) 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.Socket.ConnectCallback() at
System.Net.Sockets.Socket.RegisteredWaitCallback(Object state, Boolean
timedOut) at
System.Threading._ThreadPoolWaitOrTimerCallback.PerformWaitOrTimerCallback(Object
state, Boolean timedOut)
I'm fairly new to working with sockets (and I've only been programming for a couple of months) so I'm sure I'm going about this entirely wrong so I'd appreciate any help/suggestions.
Since you haven't posted complete code, I am assuming you are trying to use global client object. In the ConnectCallback, you need to first retrieve and typecast the client object into a Socket. So in your case, it would be:
private static void ConnectCallback(IAsyncResult ar)
{
try
{
// Retrieve the socket from the state object.
client = (Socket) ar.AsyncState;
//In case, you are using local client object
//Socket client = (Socket) ar.AsyncState;
// Complete the connection.
client.EndConnect(ar);
Console.WriteLine("Socket connected to {0}",
client.RemoteEndPoint.ToString());
// Signal that the connection has been made.
connectDone.Set();
} catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
The above code is taken from this MSDN example, have a look at it. If you fix, the first step in your approach, it should work.
I have a WCF service(selfhosted) and client, the client uses client certificate and the service uses a service certificate over HTTPS. This works fine on computer but the other throws this :
System.ServiceModel.Security.MessageSecurityException: The HTTP request was forbidden with client authentication scheme 'Anonymous'. ---> System.Net.WebException: The remote server returned an error: (403) Forbidden.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
--- End of inner exception stack trace ---
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.<>c__DisplayClass7_0`1.<CreateGenericTask>b__0(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Myapp.Client.Main.ServiceManagement.ServiceAgents.General.<GetUserConfigurations>d__5.MoveNext() in C:\Project\Myapp\Produkter\MyappUtveckling\Solution\Myapp.Client.Main\Classes\Service Management\Service Agents\General.cs:line 172
In the WCF log I can see this :
Configuration evaluation context not found.
http://msdn.microsoft.com/sv-SE/library/System.ServiceModel.Channels.HttpChannelUnexpectedResponse.aspx
Received bad HTTP response
Myapp.vshost.exe
System.ServiceModel.Security.MessageSecurityException,
System.ServiceModel, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089 The HTTP
request was forbidden with client authentication scheme
'Anonymous'. at
System.ServiceModel.Channels.HttpChannelUtilities.TraceResponseException(Exception
exception) at
System.ServiceModel.Channels.HttpChannelUtilities.ValidateAuthentication(HttpWebRequest
request, HttpWebResponse response, WebException responseException,
HttpChannelFactory1 factory) at
System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest
request, HttpWebResponse response, HttpChannelFactory1 factory,
WebException responseException, ChannelBinding channelBinding) at
System.ServiceModel.Channels.HttpChannelFactory1.HttpRequestChannel.HttpChannelAsyncRequest.ProcessResponse(HttpWebResponse
response, WebException responseException) at
System.ServiceModel.Channels.HttpChannelFactory1.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult
result) at
System.ServiceModel.Channels.HttpChannelFactory1.HttpRequestChannel.HttpChannelAsyncRequest.OnGetResponse(IAsyncResult
result) at
System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult
result) 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.HttpWebRequest.ProcessResponse() at
System.Net.HttpWebRequest.SetResponse(CoreResponseData
coreResponseData) at
System.Net.HttpWebRequest.SetAndOrProcessResponse(Object
responseOrException) at
System.Net.ConnectionReturnResult.SetResponses(ConnectionReturnResult
returnResult) at System.Net.Connection.ReadComplete(Int32 bytesRead,
WebExceptionStatus errorStatus) at
System.Net.Connection.ReadCallback(IAsyncResult asyncResult) at
System.Net.Connection.ReadCallbackWrapper(IAsyncResult asyncResult) at
System.Net.LazyAsyncResult.Complete(IntPtr userToken) at
System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result,
IntPtr userToken) at
System.Net.Security._SslStream.ProcessFrameBody(Int32 readBytes,
Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest
asyncRequest) at
System.Net.Security._SslStream.ReadFrameCallback(AsyncProtocolRequest
asyncRequest) at System.Net.AsyncProtocolRequest.CompleteRequest(Int32
result) at
System.Net.FixedSizeReader.CheckCompletionBeforeNextRead(Int32 bytes)
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) </StackTrace>
<ExceptionString>System.ServiceModel.Security.MessageSecurityException:
The HTTP request was forbidden with client authentication scheme
'Anonymous'. ---> System.Net.WebException: The remote server
returned an error: (403) Forbidden. at
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at
System.ServiceModel.Channels.HttpChannelFactory1.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult
result) --- End of inner exception stack trace
--- System.Net.WebException, System, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089
The remote server returned an error: (403)
Forbidden. at
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at
System.ServiceModel.Channels.HttpChannelFactory1.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult
result) </StackTrace> <ExceptionString>System.Net.WebException: The
remote server returned an error: (403) Forbidden. at
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at
System.ServiceModel.Channels.HttpChannelFactory1.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult
result)
http://msdn.microsoft.com/sv-SE/library/System.ServiceModel.Diagnostics.ThrowingException.aspx
Throwing an exception.
Myapp.vshost.exe
System.ServiceModel.Security.MessageSecurityException,
System.ServiceModel, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089 The HTTP
request was forbidden with client authentication scheme
'Anonymous'. at
System.ServiceModel.Channels.HttpChannelUtilities.ValidateAuthentication(HttpWebRequest
request, HttpWebResponse response, WebException responseException,
HttpChannelFactory1 factory) at
System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest
request, HttpWebResponse response, HttpChannelFactory1 factory,
WebException responseException, ChannelBinding channelBinding) at
System.ServiceModel.Channels.HttpChannelFactory1.HttpRequestChannel.HttpChannelAsyncRequest.ProcessResponse(HttpWebResponse
response, WebException responseException) at
System.ServiceModel.Channels.HttpChannelFactory1.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult
result) at
System.ServiceModel.Channels.HttpChannelFactory1.HttpRequestChannel.HttpChannelAsyncRequest.OnGetResponse(IAsyncResult
result) at
System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult
result) 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.HttpWebRequest.ProcessResponse() at
System.Net.HttpWebRequest.SetResponse(CoreResponseData
coreResponseData) at
System.Net.HttpWebRequest.SetAndOrProcessResponse(Object
responseOrException) at
System.Net.ConnectionReturnResult.SetResponses(ConnectionReturnResult
returnResult) at System.Net.Connection.ReadComplete(Int32 bytesRead,
WebExceptionStatus errorStatus) at
System.Net.Connection.ReadCallback(IAsyncResult asyncResult) at
System.Net.Connection.ReadCallbackWrapper(IAsyncResult asyncResult) at
System.Net.LazyAsyncResult.Complete(IntPtr userToken) at
System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result,
IntPtr userToken) at
System.Net.Security._SslStream.ProcessFrameBody(Int32 readBytes,
Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest
asyncRequest) at
System.Net.Security._SslStream.ReadFrameCallback(AsyncProtocolRequest
asyncRequest) at System.Net.AsyncProtocolRequest.CompleteRequest(Int32
result) at
System.Net.FixedSizeReader.CheckCompletionBeforeNextRead(Int32 bytes)
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) </StackTrace>
<ExceptionString>System.ServiceModel.Security.MessageSecurityException:
The HTTP request was forbidden with client authentication scheme
'Anonymous'. ---> System.Net.WebException: The remote server
returned an error: (403) Forbidden. at
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at
System.ServiceModel.Channels.HttpChannelFactory1.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult
result) --- End of inner exception stack trace
--- System.Net.WebException, System, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089
The remote server returned an error: (403)
Forbidden. at
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at
System.ServiceModel.Channels.HttpChannelFactory1.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult
result) </StackTrace> <ExceptionString>System.Net.WebException: The
remote server returned an error: (403) Forbidden. at
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at
System.ServiceModel.Channels.HttpChannelFactory1.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult
result)
My first thougt was certificates but both computers matches.
Im creating the channel on the client like this :
private async Task<ChannelFactory<T>> CreateChannelFactory(LoginTypeBase loginType, MyappToken token)
{
var service = await _ConsulService.GetServiceBlocking(loginType.MyappServicesToUse, forceRefresh: true, token: new CancellationTokenSource(TimeSpan.FromSeconds(30)).Token);
if (service == null)
throw new MyappServiceCommunicationException();
var cert = loginType.ClientCertificate;
var uri = loginType.GetMyappClientServiceURL(service.Address, service.Port);
var header = AddressHeader.CreateAddressHeader(nameof(MyappToken), nameof(MyappToken), token);
var endpointAddress = new EndpointAddress(uri, header);
ServiceEndpoint serviceEndpoint = null;
if (loginType.LoginType == LoginType.SmartCard || loginType.LoginType == LoginType.UsernamePasswordSLL)
{
var binding = new NetHttpsBinding("netHttpsBinding");
binding.Security.Mode = BasicHttpsSecurityMode.Transport;
if (loginType.LoginType == LoginType.SmartCard)
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
else
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
serviceEndpoint = new ServiceEndpoint(ContractDescription.GetContract(typeof(T)), binding, endpointAddress);
}
else
{
var binding = new NetHttpBinding("netHttpBinding");
serviceEndpoint = new ServiceEndpoint(ContractDescription.GetContract(typeof(T)), binding, endpointAddress);
}
serviceEndpoint.EndpointBehaviors.Add(new ProtoEndpointBehavior());
serviceEndpoint.EndpointBehaviors.Add(new CustomMessageInspectorBehavior());
var v = new ChannelFactory<T>(serviceEndpoint);
if (loginType.LoginType == LoginType.SmartCard)
{
v.Credentials.ClientCertificate.Certificate = cert;
//v.Credentials.ClientCertificate.SetCertificate(StoreLocation.CurrentUser, StoreName.My, X509FindType.FindByThumbprint, cert.Thumbprint);
}
return v;
}
The config contains extensions, behaviours and bindings(netHttpsBinding).
The Service is created from code only, nothing from its config file.
Why does it not work on the other computer?
I encounter errors using Inspect Code 9.1.3 (last version of JetBrains ReSharper Command Line Tool) with SonarQube 4.3.3.
1: "The remote name could not be resolved: 'www.jetbrains.com'"
OK, my server is offline and I cannot change that (enterprise policy)...
2: "Unknown C# language level: Default"
No hint for this one... My solution contains .NET 3.5 and .NET 4.5 C# projects (I'm using the sonar plugin "Analysis Bootstrapper For Visual Studio Projects")
How can I configure my SonarQube/sonar-runner/sonar-project to avoid this errors? Thanks for your help!
Here are some trace logs extracts:
14:12:23.940 INFO - --- EXCEPTION #1/2 [WebException]
14:12:23.975 INFO - Message = "The remote name could not be resolved: 'www.jetbrains.com'"
14:12:23.975 INFO - ExceptionPath = Root.InnerException
14:12:23.976 INFO - ClassName = System.Net.WebException
14:12:23.976 INFO - HResult = COR_E_INVALIDOPERATION=80131509
14:12:23.977 INFO - Source = System
14:12:23.978 INFO - StackTraceString = "
14:12:23.978 INFO - at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
14:12:23.978 INFO - at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
14:12:23.979 INFO - at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
14:12:23.979 INFO - "
14:12:23.979 INFO -
14:12:23.980 INFO - --- Outer ---
14:12:23.980 INFO -
14:12:23.980 INFO - --- EXCEPTION #2/2 [LoggerException]
14:12:23.981 INFO - Message = "The remote name could not be resolved: 'www.jetbrains.com'"
14:12:23.981 INFO - ExceptionPath = Root
14:12:23.981 INFO - ClassName = JetBrains.Util.LoggerException
14:12:23.981 INFO - InnerException = "Exception #1 at Root.InnerException"
14:12:23.982 INFO - HResult = COR_E_APPLICATION=80131600
14:12:23.983 INFO - StackTraceString = "
14:12:23.983 INFO - at System.Windows.Threading.DispatcherOperation.InvokeImpl()
14:12:23.983 INFO - at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:23.983 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:23.984 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
14:12:23.984 INFO - at System.Windows.Threading.DispatcherOperation.Invoke()
14:12:23.984 INFO - at System.Windows.Threading.Dispatcher.ProcessQueue()
14:12:23.984 INFO - at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
14:12:23.986 INFO - at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
14:12:23.986 INFO - at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
14:12:23.986 INFO - at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
14:12:23.986 INFO - at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
14:12:23.986 INFO - at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
14:12:23.987 INFO - at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
14:12:23.987 INFO - at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
14:12:23.987 INFO - at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
14:12:23.987 INFO - at JetBrains.Threading.JetDispatcher.InternalPumpMessagesOnce()
14:12:23.987 INFO - at JetBrains.CommandLine.InspectCode.Unattended.InspectCodeProductMain.Main(IThreading invocator, IComponentContainer container, IShellLocks shellLocks, ILogger logger, IInspectCodeSettings settings, IProductCommandLineArguments argumentsRaw)
14:12:23.987 INFO - at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
14:12:23.987 INFO - at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
14:12:23.988 INFO - at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
14:12:23.988 INFO - at JetBrains.Application.Environment.RunsPublicStaticIntMain.<>c__DisplayClass7.<.ctor>b__0()
14:12:23.988 INFO - at JetBrains.Util.Logging.Logger.Catch(Action action)
14:12:23.988 INFO - at JetBrains.Threading.JetDispatcher.Closure.Execute()
14:12:23.988 INFO - at JetBrains.Threading.JetDispatcher.ProcessQueue()
14:12:23.988 INFO - at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
14:12:23.988 INFO - at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
14:12:23.989 INFO - at System.Windows.Threading.DispatcherOperation.InvokeImpl()
14:12:23.989 INFO - at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:23.989 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:23.989 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
14:12:23.989 INFO - at System.Windows.Threading.DispatcherOperation.Invoke()
14:12:23.989 INFO - at System.Windows.Threading.Dispatcher.ProcessQueue()
14:12:23.989 INFO - at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
14:12:23.990 INFO - at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
14:12:23.990 INFO - at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
14:12:23.990 INFO - at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
14:12:23.990 INFO - at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
14:12:23.990 INFO - at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
14:12:23.990 INFO - at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
14:12:23.990 INFO - at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
14:12:23.991 INFO - at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
14:12:23.991 INFO - at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
14:12:23.991 INFO - at JetBrains.DataFlow.Lifetimes.Using(Action`1 ?)
14:12:23.992 INFO - at JetBrains.Application.Environment.IJetHostEx.RunHostMessageLoop(IComponentContainer containerEnv)
14:12:23.992 INFO - at JetBrains.Application.Environment.HostParameters.JetHostParametersCaller.RunMainLoop(ComponentContainer containerEnv)
14:12:23.992 INFO - at JetBrains.Application.Environment.JetEnvironment.InternalRun(JetHostParametersCaller host, ComponentContainer containerEnv)
14:12:23.992 INFO - at JetBrains.Application.Environment.JetEnvironment.CreateAndRun(Full hostparams)
14:12:23.992 INFO - at JetBrains.CommandLine.InspectCode.InspectCodeProgram.Main(Assembly assembly, HostInfo hostInfo, String[] args)
14:12:23.993 INFO - at JetBrains.CommandLine.InspectCode.InspectCodeProgram.<Main>b__1(RunnerContext ctx)
14:12:23.993 INFO - "
...
14:12:46.683 INFO - --- EXCEPTION #1/2 [InvalidOperationException]
14:12:46.683 INFO - Message = "Unknown C# language level: Default"
14:12:46.683 INFO - ExceptionPath = Root.InnerException
14:12:46.683 INFO - ClassName = System.InvalidOperationException
14:12:46.684 INFO - HResult = COR_E_INVALIDOPERATION=80131509
14:12:46.684 INFO - Source = JetBrains.ReSharper.Psi.CSharp
14:12:46.684 INFO - StackTraceString = "
14:12:46.685 INFO - at JetBrains.ReSharper.Psi.CSharp.CSharpExtensionMethods.GetCSharpVersion(CSharpLanguageLevel level)
14:12:46.685 INFO - at JetBrains.ReSharper.Psi.CSharp.Impl.Tree.AttributeStub.MyConstructorReference.Resolve(IResolveContext resolveContext)
14:12:46.685 INFO - at JetBrains.ReSharper.Psi.ExtensionsAPI.Resolve.Managed.ResolveContext.ResolveWithInfoCalculator(IManagedReferenceImpl reference, Object state, IResolveContext resolveContext)
14:12:46.685 INFO - at JetBrains.ReSharper.Psi.Impl.Resolve.Managed.CalculationProcess.Get[TKey,TParameter,TValue](CascadingCacheKey cacheKey, TKey key, TParameter param, IResolveContext resolveContext, Func`4 calculator)
14:12:46.685 INFO - at JetBrains.ReSharper.Psi.ExtensionsAPI.Resolve.Managed.ResolveContext.ResolveWithInfo(IManagedReference reference)
14:12:46.685 INFO - at JetBrains.ReSharper.Daemon.CSharp.Stages.SmartResolverProcess.ScopeResolver.VisitElement(ITreeNode element)
14:12:46.686 INFO - at JetBrains.ReSharper.Psi.Resolve.Resolver.ProcessAfterInterior(ITreeNode element)
14:12:46.686 INFO - at JetBrains.ReSharper.Daemon.CSharp.Stages.SmartResolverProcess.ScopeResolver.ProcessAfterInterior(ITreeNode element)
14:12:46.686 INFO - at JetBrains.ReSharper.Psi.RecursiveElementProcessorExtensions.ProcessDescendantForResolve(IRecursiveElementProcessor processor, ITreeNode descendant)
14:12:46.686 INFO - at JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendantsForResolve(IRecursiveElementProcessor processor)
14:12:46.686 INFO - at JetBrains.ReSharper.Psi.RecursiveElementProcessorExtensions.ProcessDescendantForResolve(IRecursiveElementProcessor processor, ITreeNode descendant)
14:12:46.687 INFO - at JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendantsForResolve(IRecursiveElementProcessor processor)
14:12:46.687 INFO - at JetBrains.ReSharper.Psi.RecursiveElementProcessorExtensions.ProcessDescendantForResolve(IRecursiveElementProcessor processor, ITreeNode descendant)
14:12:46.687 INFO - at JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendantsForResolve(IRecursiveElementProcessor processor)
14:12:46.687 INFO - at JetBrains.ReSharper.Psi.RecursiveElementProcessorExtensions.ProcessDescendantForResolve(IRecursiveElementProcessor processor, ITreeNode descendant)
14:12:46.687 INFO - at JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendantsForResolve(IRecursiveElementProcessor processor)
14:12:46.687 INFO - at JetBrains.ReSharper.Psi.RecursiveElementProcessorExtensions.ProcessDescendantForResolve(IRecursiveElementProcessor processor, ITreeNode descendant)
14:12:46.687 INFO - at JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendantsForResolve(IRecursiveElementProcessor processor)
14:12:46.687 INFO - at JetBrains.ReSharper.Psi.RecursiveElementProcessorExtensions.ProcessDescendantForResolve(IRecursiveElementProcessor processor, ITreeNode descendant)
14:12:46.687 INFO - at JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendantsForResolve(IRecursiveElementProcessor processor)
14:12:46.688 INFO - at JetBrains.ReSharper.Psi.RecursiveElementProcessorExtensions.ProcessDescendantForResolve(IRecursiveElementProcessor processor, ITreeNode descendant)
14:12:46.688 INFO - at JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendantsForResolve(IRecursiveElementProcessor processor)
14:12:46.688 INFO - at JetBrains.ReSharper.Psi.Resolve.Resolver.Process(ITreeNode topElement)
14:12:46.688 INFO - at JetBrains.Application.Threading.Tasks.TaskHost.<>c__DisplayClass11.<Create>b__e(Object state)
14:12:46.688 INFO - "
14:12:46.689 INFO -
14:12:46.689 INFO - --- Outer ---
14:12:46.689 INFO -
14:12:46.689 INFO - --- EXCEPTION #2/2 [LoggerException]
14:12:46.689 INFO - Message = "Unknown C# language level: Default"
14:12:46.689 INFO - ExceptionPath = Root
14:12:46.689 INFO - ClassName = JetBrains.Util.LoggerException
14:12:46.690 INFO - InnerException = "Exception #1 at Root.InnerException"
14:12:46.690 INFO - HResult = COR_E_APPLICATION=80131600
14:12:46.690 INFO - StackTraceString = "
14:12:46.690 INFO - at System.Threading.Tasks.Task.Execute()
14:12:46.691 INFO - at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:46.691 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:46.691 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
14:12:46.691 INFO - at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
14:12:46.691 INFO - at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
14:12:46.692 INFO - at System.Threading.Tasks.TaskScheduler.TryRunInline(Task task, Boolean taskWasPreviouslyQueued, Object threadStatics)
14:12:46.692 INFO - at System.Threading.Tasks.Task.WrappedTryRunInline(TaskScheduler currentScheduler, Object currentSchedulerStatics)
14:12:46.692 INFO - at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
14:12:46.692 INFO - at JetBrains.Application.Threading.Tasks.TaskBarrier.DisposeUnmanagedResources()
14:12:46.692 INFO - at JetBrains.Util.SafeDisposable.DisposeInternal()
14:12:46.693 INFO - at JetBrains.ReSharper.Daemon.CSharp.Stages.SmartResolverProcess.Execute(Action`1 committer)
14:12:46.693 INFO - at JetBrains.ReSharper.Feature.Services.Daemon.DaemonProcessBase.<>c__DisplayClassc.<DoHighlighting>b__5(IDaemonStage stage)
14:12:46.693 INFO - at JetBrains.Application.Threading.Tasks.TaskBarrier.<>c__DisplayClassc.<>c__DisplayClasse.<EnqueueDependentJobs>b__a()
14:12:46.693 INFO - at JetBrains.Application.Threading.Tasks.TaskHost.<>c__DisplayClass11.<Create>b__e(Object state)
14:12:46.693 INFO - at System.Threading.Tasks.Task.Execute()
14:12:46.694 INFO - at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:46.694 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:46.694 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
14:12:46.694 INFO - at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
14:12:46.695 INFO - at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
14:12:46.695 INFO - at JetBrains.Application.Threading.Tasks.Scheduler.JetSchedulerThread.ThreadPoolProc()
14:12:46.695 INFO - at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:46.695 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:46.695 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
14:12:46.696 INFO - at System.Threading.ThreadHelper.ThreadStart()
14:12:46.696 INFO - "
Try installing JB InspectCode 9.2. At least "Unknown C# language level: Default" exception should be fixed there https://youtrack.jetbrains.com/issue/RSRP-442801
It sounds like you are facing issues from the JetBrains ReSharper Command Line Tools itselve - which doesn't relate to the SonarQube integration.
Nevertheless, I'd just like to add that the "Analysis Bootstrapper For Visual Studio Projects" plugin is deprecated and that it has been replaced by the "MSBuild SonarQube Runner", which natively integrates with MSBuild.
You can find an example on how to analyze C# project using the ReSharper Command Line Tools & the MSBuild SonarQube Runner here: http://docs.sonarqube.org/display/PLUG/ReSharper+Plugin
Whenever I try to run this code: (code shortened to keep the post short)
// Generate a random capital letter
char key = (char)(_random.Next(24) + 65);
// 50% make it lowercase
if (_random.Next(2) == 0)
{
key = Char.ToLower(key);
}
SendKeys.SendWait(key.ToString());
I get this error:
Unhandled Exception: System.ComponentModel.Win32Exception: The operation completed successfully
at System.Windows.Forms.SendKeys.SendInput(Byte[] oldKeyboardState, Queue previousEvents)
at System.Windows.Forms.SendKeys.Send(String keys, Control control, Boolean wait)
at System.Windows.Forms.SendKeys.SendWait(String keys)
at DrunkPC.Program.DrunkKeyboardThread() in c:\Users\SPC\Documents\Visual Studio 2013\Projects\DrunkPC\Program.cs:line 91
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()
Line 91 is:
SendKeys.SendWait(key.toString());