I'm using Resharper Ultimate 2017.3.1
When I try to debug a unit tests
[DataTestMethod]
[DataRow("bla", "blub")]
public void Test_When_Then() { ... }
Then the test stops debugging, changes to state inconclusive and the following error is shown in the resharper test explorer window:
2018.01.17 13:02:20.367 ERROR Transition failed: Transition from state on event . Cause:
System.ArgumentException: There should be at least one test in the
test run. Parametername: tests --->
System.ServiceModel.FaultException: There should be at least one test
in the test run. Parametername: tests Server stack trace: at
System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime
operation, ProxyRpc& rpc) at
System.ServiceModel.Channels.ServiceChannel.Call(String action,
Boolean oneway, ProxyOperationRuntime operation, Object[] ins,
Object[] outs, TimeSpan timeout) at
System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage
methodCall, ProxyOperationRuntime operation) at
System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage
message) Exception rethrown at [0]: at
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg) at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type) at
Microsoft.VisualStudio.TestPlatform.Core.ITestExecutorService.StartTestRun(IEnumerable1
tests, String testRunSettings, TestExecutionContext executionContext,
String dataCollectorServiceUri) at
JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.Wcf.TestExecutorServiceProxy.StartTestRun(IEnumerable1
tests, String testRunSettings, TestExecutionContext executionContext,
String dataCollectorServiceUri) --- End of inner exception stack trace
--- at JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.Wcf.TestExecutorServiceProxy.StartTestRun(IEnumerable1
tests, String testRunSettings, TestExecutionContext executionContext,
String dataCollectorServiceUri) at
JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.MsTestExecutionProtocol.StartTestRun()
at
Appccelerate.StateMachine.Machine.ActionHolders.ArgumentLessActionHolder.Execute(Object
argument) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\ActionHolders\ArgumentLessActionHolder.cs:line
37 at
Appccelerate.StateMachine.Machine.States.State2.ExecuteEntryAction(IActionHolder
actionHolder, ITransitionContext`2 context) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\States\State.cs:line
340
--- EXCEPTION #1/1 [LoggerException] Message = “ Transition failed: Transition from state on event .
Cause: System.ArgumentException: There should be at least one test in
the test run. Parametername: tests --->
System.ServiceModel.FaultException: There should be at least one test
in the test run. Parametername: tests
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime
operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins,
Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage
methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage
message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
at Microsoft.VisualStudio.TestPlatform.Core.ITestExecutorService.StartTestRun(IEnumerable1
tests, String testRunSettings, TestExecutionContext executionContext,
String dataCollectorServiceUri)
at JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.Wcf.TestExecutorServiceProxy.StartTestRun(IEnumerable1
tests, String testRunSettings, TestExecutionContext executionContext,
String dataCollectorServiceUri)
--- End of inner exception stack trace ---
at JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.Wcf.TestExecutorServiceProxy.StartTestRun(IEnumerable1
tests, String testRunSettings, TestExecutionContext executionContext,
String dataCollectorServiceUri)
at JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.MsTestExecutionProtocol.StartTestRun()
at Appccelerate.StateMachine.Machine.ActionHolders.ArgumentLessActionHolder.Execute(Object
argument) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\ActionHolders\ArgumentLessActionHolder.cs:line
37
at Appccelerate.StateMachine.Machine.States.State2.ExecuteEntryAction(IActionHolder
actionHolder, ITransitionContext2 context) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\States\State.cs:line
340 ” ExceptionPath = Root ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600 StackTraceString = “ at
JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.MsTestExecutionProtocol.<.ctor>b__10(Object
sender, TransitionExceptionEventArgs2 args)
at Appccelerate.StateMachine.Machine.StateMachine2.RaiseEvent[T](EventHandler1
eventHandler, T arguments, ITransitionContext2 context, Boolean
raiseEventOnException) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\StateMachine.cs:line
404
at Appccelerate.StateMachine.Machine.StateMachine2.OnExceptionThrown(ITransitionContext2
context, Exception exception) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\StateMachine.cs:line
260
at Appccelerate.StateMachine.Machine.Contexts.TransitionContext2.OnExceptionThrown(Exception
exception) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\Contexts\TransitionContext.cs:line
74
at Appccelerate.StateMachine.Machine.States.State2.HandleException(Exception
exception, ITransitionContext2 context) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\States\State.cs:line
307
at Appccelerate.StateMachine.Machine.States.State2.HandleEntryActionException(ITransitionContext2
context, Exception exception) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\States\State.cs:line
357
at Appccelerate.StateMachine.Machine.States.State2.ExecuteEntryAction(IActionHolder
actionHolder, ITransitionContext2 context) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\States\State.cs:line
345
at Appccelerate.StateMachine.Machine.States.State2.ExecuteEntryActions(ITransitionContext2
context) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\States\State.cs:line
330
at Appccelerate.StateMachine.Machine.States.State2.Entry(ITransitionContext2
context) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\States\State.cs:line
247
at Appccelerate.StateMachine.Machine.States.State2.EnterShallow(ITransitionContext2
context) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\States\State.cs:line
285
at Appccelerate.StateMachine.Machine.States.State2.EnterHistoryNone(ITransitionContext2
context) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\States\State.cs:line
429
at Appccelerate.StateMachine.Machine.States.State2.EnterByHistory(ITransitionContext2
context) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\States\State.cs:line
263
at Appccelerate.StateMachine.Machine.Transitions.Transition2.Fire(ITransitionContext2
context) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\Transitions\Transition.cs:line
87
at Appccelerate.StateMachine.Machine.States.State2.Fire(ITransitionContext2
context) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\States\State.cs:line
222
at Appccelerate.StateMachine.Machine.StateMachine2.Fire(TEvent eventId, Object eventArgument) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\Machine\StateMachine.cs:line
230
at Appccelerate.StateMachine.PassiveStateMachine2.ProcessQueuedEvents()
in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\PassiveStateMachine.cs:line
339
at Appccelerate.StateMachine.PassiveStateMachine2.Execute() in C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\PassiveStateMachine.cs:line
324
at Appccelerate.StateMachine.PassiveStateMachine2.Fire(TEvent eventId, Object eventArgument) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\PassiveStateMachine.cs:line
177
at Appccelerate.StateMachine.PassiveStateMachine2.Fire(TEvent eventId) in
C:\projects\appccelerate\repos\statemachine\source\Appccelerate.StateMachine\PassiveStateMachine.cs:line
163
at JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.Wcf.TestExecutorServiceClient.TestConnection(IEnumerable1
dummyTestResults)
at SyncInvokeTestConnection(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&
rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&
rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc&
rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&
rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&
rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&
rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&
rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&
rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&
rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext
request, Boolean cleanThread, OperationContext
currentOperationContext)
at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext
request, OperationContext currentOperationContext)
at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult
result)
at System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult
result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult
result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.TryReceiveAsyncResult.OnReceive(IAsyncResult
result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult
result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.ServiceModel.Channels.SynchronizedMessageSource.ReceiveAsyncResult.OnReceiveComplete(Object
state)
at System.ServiceModel.Channels.SessionConnectionReader.OnAsyncReadComplete(Object
state)
at System.ServiceModel.Channels.StreamConnection.OnRead(IAsyncResult
result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult
result)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Security.NegotiateStream.ProcessFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count,
AsyncProtocolRequest asyncRequest)
at System.Net.Security.NegotiateStream.ReadCallback(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.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.ServiceModel.Channels.ConnectionStream.IOAsyncResult.OnAsyncIOComplete(Object
state)
at System.ServiceModel.Channels.PipeConnection.OnAsyncReadComplete(Boolean
haveResult, Int32 error, Int32 numBytes)
at System.ServiceModel.Channels.OverlappedContext.CompleteCallback(UInt32
error, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32
error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32
errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP) ”
Has anyone had this error too and knows how to fix it so that I can debug my unit tests again?
Thanks in advance
I had this error when updating ReSharper, it turned out to be a problem with the referenced NuGet packages related to Microsoft.VisualStudio.TestPlatform were outdated.
Create a new test project and compare the versions of these assemblies which will be added automatically when the project is created.
Using version 14.0.0.1 is working for me for the following assemblies:
ReSharper 2017.3.1
VS 2017 15.5.3
Related
Please help me on below error : The exception is being thrown while consuming the service using client code
Exception Details: System.Net.WebException: The remote server returned an error: (405) Method Not Allowed.
using (var customerCreditService = new CustomerCreditServiceClient())
{
var creditLimit = customerCreditService.GetCreditLimit(customer.Firstname,
customer.Surname, customer.DateOfBirth);
(**Exception thrown while calling this method**)
}
Error Message : The remote server returned an unexpected response: (405) Method Not Allowed.
Stack Trace : Server stack trace:
at >System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory1 factory, WebException responseException, ChannelBinding channelBinding) at
System.ServiceModel.Channels.HttpChannelFactory1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at App.ICustomerCreditService.GetCreditLimit(String firstname, String surname, DateTime dateOfBirth)
at App.CustomerCreditServiceClient.GetCreditLimit(String firstname, String surname, DateTime dateOfBirth) in
\App\CustomerCreditService.cs:line 53
at App.Customer.doCreditCheck(Customer customer) in
\App\Customer.cs:line 36
at App.SilverCustomer.doCreditCheck(Customer customer) in \App\SilverCustomer.cs:line 14
at App.CustomerService.AddCustomer(Customer customer) in \App\App\CustomerService.cs:line 64
at App.Tests.CustomerUnitTests.AddCustomer_DoCreditCheck_ForSilver() in \App.Tests\CustomerUnitTests.cs:line 74
My service was working well, and suddenly It started occurred the following error:
An unsecured or incorrectly secured fault was received from the other
party. See the inner FaultException for the fault code and detail.
I am getting this error at this step of my code:
var channel = (WSTrustChannel)trustChannelFactory.CreateChannel();
var token = channel.Issue(rst, out rstr) as GenericXmlSecurityToken;
any thought please on what the matter is or how to fix it
Thank you
EDIT:
<InnerException><ExceptionType>System.ServiceModel.FaultException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>An error occurred when verifying security for the message.</Message><StackTrace> at System.ServiceModel.Channels.CommunicationObject.Fault(Exception exception) at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout) at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at System.ServiceModel.Security.IWSTrustContract.Issue(Message message) at System.ServiceModel.Security.WSTrustChannel.Issue(RequestSecurityToken rst, RequestSecurityTokenResponse& rstr) at WebService.RequestToken(String serviceNamespace, WSTrustChannelFactory trustChannelFactory) at WebService.RequestSecurityToken() at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values) at System.Web.Services.Protocols.WebServiceHandler.Invoke() at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest() at System.Web.Services.Protocols.SyncSessionlessHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) at System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(Exception error) at System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) at System.Web.Hosting.ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType) </StackTrace><ExceptionString>System.ServiceModel.FaultException: An error occurred when verifying security for the message.</ExceptionString></InnerException>
I have a api controller to recieve bunch of data from a webservice and translate it to a JSON.
When it fetches larger data pack, an error occures:
Timeouts are not supported on this stream
My controller is pretty simple:
public class ChangesPickupController : ApiController
{
[HttpPost]
public ChangeStructure[] GetChangesPickup(string id, int page, int toPage, UserInfoStructure uis)
{
var manager = new CkpClientManager();
try
{
var dt = DateTime.ParseExact(id, "yyyyMMddHHmmss", CultureInfo.InvariantCulture);
using (var client = manager.GetClient())
{
return client.GetChanges(uis, dt, page, toPage);
}
}
catch (Exception ex)
{
Console.WriteLine("ERROR: " + ex.Message);
throw new Exception(ex.Message);
}
}
}
Do you have any clue, what might be a problem? Should I change some attributes for streaming somewhere or what?
Thanks in advance, JiKra
EDIT:
Well, here is my stack:
Server stack trace:
at System.IO.Stream.get_ReadTimeout()
at System.ServiceModel.Channels.DelegatingStream.get_ReadTimeout()
at System.ServiceModel.Channels.DelegatingStream.get_ReadTimeout()
at System.ServiceModel.Channels.HttpInput.WebResponseHttpInput.WebResponseInputStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.ServiceModel.Channels.MessageEncoder.BufferMessageStream(Stream stream, BufferManager bufferManager, Int32 maxBufferSize)
at System.ServiceModel.Channels.MessageEncoder.ReadMessage(Stream stream, BufferManager bufferManager, Int32 maxBufferSize, String contentType)
at System.ServiceModel.Channels.HttpInput.ReadChunkedBufferedMessage(Stream inputStream)
at System.ServiceModel.Channels.HttpInput.ParseIncomingMessage(HttpRequestMessage httpRequestMessage, Exception& requestException)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at CkpSelfHost3.CkpWs.ICkpWS.GetChangesPickup(UserInfoStructure UserInfo, DateTime Datum, Int32 Strana, Int32 NaStranu)
at CkpSelfHost3.CkpWs.CkpWSClient.GetChangesPickup(UserInfoStructure UserInfo, DateTime Datum, Int32 Strana, Int32 NaStranu) in C:\Users\krakora\documents\visual studio 20
Host3\CkpSelfHost3\Service References\CkpWs\Reference.cs:line 2576
at CkpSelfHost3.Controllers.ChangesPickupController.GetChangesPickup(String id, Int32 page, Int32 toPage, UserInfoStructure uis) in C:\Users\krakora\documents\visual studio 2
fHost3\CkpSelfHost3\Controllers\ChangesPickupController.cs:line 30
Well, the problem was on the vendor's side in webservice provider.
JiKra
I have uploaded my application to Client .We are getting "System.Runtime.Remoting.RemotingException: Cannot load type" error .I am new to use remoting.Can any one let me know how to resolve this issue.Same set of files are working in my local server .Its throughing System.Runtime.Remoting.RemotingException: Cannot load type error while connecting to remote server .I have tried several ways but in vain
Error Occured while connecting RemoteServer.System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.Remoting.RemotingException: Cannot load type RemoteServer.SPN.ChargebackSPNRemoteServer, RemoteServer.SPN, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null.
Server stack trace:
at System.Runtime.Remoting.Activation.ActivationListener.Activate(IConstructionCallMessage ctorMsg)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.Runtime.Remoting.Activation.IActivator.Activate(IConstructionCallMessage msg)
at System.Runtime.Remoting.Activation.LocalActivator.DoRemoteActivation(IConstructionCallMessage ctorMsg)
at System.Runtime.Remoting.Activation.LocalActivator.Activate(IConstructionCallMessage ctorMsg)
at System.Runtime.Remoting.Activation.AppDomainLevelActivator.Activate(IConstructionCallMessage ctorMsg)
at System.Runtime.Remoting.Messaging.ClientContextTerminatorSink.SyncProcessMessage(IMessage reqMsg)
at System.Runtime.Remoting.Activation.ActivationServices.Activate(RemotingProxy remProxy, IConstructionCallMessage ctorMsg)
at System.Runtime.Remoting.Proxies.RemotingProxy.InternalActivate(IConstructionCallMessage ctorMsg)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(IMessage reqMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at RemoteServer.SPN.ChargebackSPNRemoteServer..ctor()
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at Com. Service.Items.InProcess.SPNServiceProvider.ConnectDBServerRemote(String p_strURLforRemoteSite)
2014-10-03 11:00:58,251 [5084] ERROR - InnerException RemoteServer.System.Runtime.Remoting.RemotingException: Cannot load type RemoteServer.SPN.ChargebackSPNRemoteServer, . RemoteServer.SPN, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null.
Server stack trace:
at System.Runtime.Remoting.Activation.ActivationListener.Activate(IConstructionCallMessage ctorMsg)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.Runtime.Remoting.Activation.IActivator.Activate(IConstructionCallMessage msg)
at System.Runtime.Remoting.Activation.LocalActivator.DoRemoteActivation(IConstructionCallMessage ctorMsg)
at System.Runtime.Remoting.Activation.LocalActivator.Activate(IConstructionCallMessage ctorMsg)
at System.Runtime.Remoting.Activation.AppDomainLevelActivator.Activate(IConstructionCallMessage ctorMsg)
at System.Runtime.Remoting.Messaging.ClientContextTerminatorSink.SyncProcessMessage(IMessage reqMsg)
at System.Runtime.Remoting.Activation.ActivationServices.Activate(RemotingProxy remProxy, IConstructionCallMessage ctorMsg)
at System.Runtime.Remoting.Proxies.RemotingProxy.InternalActivate(IConstructionCallMessage ctorMsg)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(IMessage reqMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at RemoteServer.SPN.ChargebackSPNRemoteServer..ctor()
I am trying to create an application that oversees message queues as they are processing messages.
To snapshot the message queue, i wrote the following code:
MessageEnumerator msgEnum = null;
try
{
// some code that fetches q (the queue)
msgEnum = q.GetMessageEnumerator2();
while (msgEnum.MoveNext())
{
Message current = msgEnum.Current;
Envelope msg = current.Body as Envelope;
// do something with the message
}
}
catch (Exception ex)
{
// handle exception
}
finally
{
if (msgEnum != null)
msgEnum.Close();
}
However, while another application is sending lots and lots of messages into the queue, i get the aforementioned exception.
I'm really confused as to why this is happening and what i need to do to make it work.
I also tried using GetAllMessages which resulted in the same exception.
Any help and/or explanations would be welcome.
edit:
the stack trace:
Error message: System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: An invalid handle was passed to the function. (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.Messaging.MessageQueueException: An invalid handle was passed to the function.
at System.Messaging.MessageEnumerator.MoveNext(TimeSpan timeout)
at Astea.AO.API.ControllerService.GetMessagesHeaders(String profileName, MessageQueueType queueType) in c:\Astea Alliance 11.0\Src\Framework\Astea.AO.API\Astea.AO.API.ControllerService\ControllerService.cs:line 170
at SyncInvokeGetMessagesHeaders(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)).
Stack trace: at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at APIConsoleWeb.Utils.Util.ReportError(String message) in c:\Astea Alliance 11.0\API.Controller\API.Controller\Utils\Util.cs:line 14
at APIConsoleWeb.Controllers.QueueMessagesController.GetMessagesHeaders(String profileName, MessageQueueType queueType) in c:\Astea Alliance 11.0\API.Controller\API.Controller\Controllers\QueueMessagesController.cs:line 37
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
at System.Web.Http.Tracing.Tracers.HttpActionDescriptorTracer.<>c__DisplayClass4.<ExecuteAsync>b__1()
at System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEndAsync[TResult](ITraceWriter traceWriter, HttpRequestMessage request, String category, TraceLevel level, String operatorName, String operationName, Action`1 beginTrace, Func`1 execute, Action`2 endTrace, Action`1 errorTrace)
at System.Web.Http.Tracing.Tracers.HttpActionDescriptorTracer.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
at System.Web.Http.Controllers.ApiControllerActionInvoker.InvokeActionAsyncCore(HttpActionContext actionContext, CancellationToken cancellationToken)
at System.Web.Http.Controllers.ApiControllerActionInvoker.InvokeActionAsync(HttpActionContext actionContext, CancellationToken cancellationToken)
at System.Web.Http.Tracing.Tracers.HttpActionInvokerTracer.<>c__DisplayClass4.<System.Web.Http.Controllers.IHttpActionInvoker.InvokeActionAsync>b__1()
at System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEndAsync[TResult](ITraceWriter traceWriter, HttpRequestMessage request, String category, TraceLevel level, String operatorName, String operationName, Action`1 beginTrace, Func`1 execute, Action`2 endTrace, Action`1 errorTrace)
at System.Web.Http.Tracing.Tracers.HttpActionInvokerTracer.System.Web.Http.Controllers.IHttpActionInvoker.InvokeActionAsync(HttpActionContext actionContext, CancellationToken cancellationToken)
at System.Web.Http.Controllers.ActionFilterResult.ActionInvoker.InvokeActionAsync()
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
at System.Web.Http.Controllers.ActionFilterResult.ExecuteAsync(CancellationToken cancellationToken)
at System.Web.Http.ApiController.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)
at System.Web.Http.Tracing.Tracers.HttpControllerTracer.<ExecuteAsyncCore>d__5.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
at System.Web.Http.Tracing.Tracers.HttpControllerTracer.ExecuteAsyncCore(HttpControllerContext controllerContext, CancellationToken cancellationToken)
at System.Web.Http.Tracing.Tracers.HttpControllerTracer.<>c__DisplayClass3.<System.Web.Http.Controllers.IHttpController.ExecuteAsync>b__0()
at System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEndAsync[TResult](ITraceWriter traceWriter, HttpRequestMessage request, String category, TraceLevel level, String operatorName, String operationName, Action`1 beginTrace, Func`1 execute, Action`2 endTrace, Action`1 errorTrace)
at System.Web.Http.Tracing.Tracers.HttpControllerTracer.System.Web.Http.Controllers.IHttpController.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Web.Http.Tracing.Tracers.RequestMessageHandlerTracer.<>n__FabricatedMethod6(HttpRequestMessage , CancellationToken )
at System.Web.Http.Tracing.Tracers.RequestMessageHandlerTracer.<>c__DisplayClass4.<SendAsync>b__1()
at System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEndAsync[TResult](ITraceWriter traceWriter, HttpRequestMessage request, String category, TraceLevel level, String operatorName, String operationName, Action`1 beginTrace, Func`1 execute, Action`2 endTrace, Action`1 errorTrace)
at System.Web.Http.Tracing.Tracers.RequestMessageHandlerTracer.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Web.Http.HttpServer.<>n__FabricatedMethod9(HttpRequestMessage , CancellationToken )
at System.Web.Http.HttpServer.<SendAsync>d__0.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
at System.Web.Http.HttpServer.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Web.Http.WebHost.HttpControllerHandler.<ProcessRequestAsyncCore>d__0.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
at System.Web.Http.WebHost.HttpControllerHandler.ProcessRequestAsyncCore(HttpContextBase contextBase)
at System.Web.Http.WebHost.HttpControllerHandler.ProcessRequestAsync(HttpContext context)
at System.Web.HttpTaskAsyncHandler.<>c__DisplayClass1.<System.Web.IHttpAsyncHandler.BeginProcessRequest>b__0()
at System.Web.TaskAsyncHelper.BeginTask(Func`1 taskFunc, AsyncCallback callback, Object state)
at System.Web.HttpTaskAsyncHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)