Mono/Unity3D disconnecting from a wcf duplex service after a while - wcf

I have a client using unity3D which connects to a WCF duplex service. The client connects and receives data all the time, but after a random amount of minutes it just stops receiving data. The service stays stable and can be reconnected without any problem, also no error is thrown.
I have set up other test clients using .net 3.5 and the exact same code i use on mono and the client stays connected pretty much forever.
Does WCF in mono have known connectivity issues? How can i prevent that from happening?

I was facing the same problem, until I copy another version of System.ServiceModel.dll and System.Runtime.Serialization.dll in my Unity Asset (or plugin) folder. You can find these assemblies here : https://www.dropbox.com/sh/z05gp6zsqhshvpx/S-Wywb7NDh
(Running with Unity 4.2.2f1)
Have a good day !

Related

Error -1072824317 trying to use MSMQ with WCF

I have a Silverlight client which is talking to a WCF Service and performing some actions
Most of the time these actions will be quick, but often they wont be so I need a way of avoiding WCF timeouts by essentially passing the work onto its own "thread" server side and having a way for the client to know when the operation has completed
I have searched on here and found reference to the article below
http://msdn.microsoft.com/en-us/magazine/cc163482.aspx
I have downloaded the sample
It was targeting .NET 2 so I have updated it to 4.5 and the required IDesign folder didn’t exist in c:\program files so I have created it
Once I installed MSMQ and tried to run the client I get the error below
HResult=-1072824317
Message=An error occurred while opening the queue:Unrecognized error -1072824317 (0xc00e0003). The message cannot be sent or received from the queue. Ensure that MSMQ is installed and running. Also ensure that the queue is available to open with the required access mode
Does anyone know what the problem is here? I am very new to MSMQ
I notice that this code is very old (2006), so is there a better way of doing this nowadays?
Paul

Error in log after windows restart when subscriber is installed as a service

I'm using NserviceBus 2.0 with pub/sub mode.
My subscribers are installed as a windows service.
However after computer restart I always get the following problem in log : "Problem in peeking a message from queue: ServiceNotAvailable".
After digging into source code I found that this is NserviceBus custom error and it occurs in MsmqTransport class. It seems like my subscriber's service is started before Msmq service. Bus this should be impossible because subscriber's service has Msmq as dependency.
After some time service is starting and working correctly. But I have several megabytes of errors in log. And sometimes service is not even starting.
Can anyone help me? I'm using Windows 7. Msmq is installed with NserviceBus utils.
You need to configure your service to be dependent on the MSMQ service. This is should be automatically taken care of if you're using the NServiceBus host.
Installing a Windows Service with dependencies
Have seen the same problem. Actually the impact was even worse since we used log4net and SmtpAppender. Took down the mailserver, ouch! Seems like this is fixed in NSB 3. It sets number of workerthreads to zero and logs "please reboot service". You can even execute own code when the error occurs. Config with lambda using OnCriticalError. We ended up patching the NSB 2 code, since we havent upgraded to NSB 3 yet. Handling MSMQExceptions, logging and stopping the process on errorcode ServiceNotAvailable like they already do when you don't have correct rights to queue. You should probably stop the service on any MSMQExceptions exept IOTimeout.

WCF App recieving multiple requests per second causing other asp.net apps to stop responding and deadlock

We have a WCF Service using a wsHttpBinding. When it recieves many requests in a short period of time (25 per second for a few minutes) it stops working and our other asp.net applications and pages to stop responding as well. Some of them timeout and eventually we see the following in the event viewer:
ISAPI 'c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll' reported itself as unhealthy for the following reason: 'Deadlock detected'.
Often we get calls about the problem first and restart IIS to solve the problem.
How can we configure our WCF service to handle this many transmissions or at least configure it to not take down our other applications when it can't handle the load. Our classic asp applications run without issues during this time, it's only our .net apps that are effected.
are you running all your asp/wcf sites in the same AppPool? if so, I'd suggest creating a new one and running the WCF service just in that. That in itself might be enough to solve the problem from a practical perspective.
Also can you target a more recent version of the framework with your WCF app? (and leave the other apps the same) It will isolate it much better.

WCF invalidoperationexception

I encounter this strange problem while using wcf services along with
L2SQL DAL.
The server is hosted at the localhost and contains an implementation of the correspondent interface. The client is familiar with the interface and occasionally queries the database via the exposed service using tcp transport.
When client runs locally everything's just fine.
But whenever client runs at another machine the 'InvalidOperationException' is thrown in the System.Data.dll (the transport still gets delivered) and over the time the channel enters 'Faulted' state(and transport fails to get delivered).
I feel I'm missing something very basic in my application.
Could anyone please point out possible reasons for such and odd behaviour?
An exception in the service will cause the channel to enter a Faulted state, if you do not clean up properly. See: http://bloggingabout.net/blogs/erwyn/archive/2006/12/09/WCF-Service-Proxy-Helper.aspx
for how to clean up the proxy when the service fails.
On your problem with L2SQL, looks like you allready found a solution.

WCF service does not respond, how to debug?

consider a WCF service, which is heavily used and behaves normally. But then is stopps responding. In the sevice level message trace you can see the outgoing message on the client, but no incoming message on the server. On transport level theres a incoming message and then nothing. After 60 seconds the client throws a TimeoutException.
What can cause a behavior like this?
What would you do to debug this behavior?
Is it possible that this behavior is caused by too many concurrent connections/sessions?
EDIT:
Client and Server are on the same machine. Both are .NET apps. When the client is restarted the problem sometimes does not happen. Also the problem does only appear on a single machine. I was not able to reproduce the behavior on any other machine.
Regards
Michael
I understand you have no problem on network level as you have mentioned that you can see incoming request on transport level.
So the first thing to check does the service is up and does it works if the client is on the same machine.
Also you can analyze incoming messages may be the problem can be there.
Here WireShark will be your friend.
Also check can you view the wsdl from the client machine. By the way are your clients also .NET apps?
You can configure tracing using the application’s configuration file—either Web.config for Web-hosted applications, or Appname.config for self-hosted applications by Service Trace Viewer
or use from debug tools such Debug Diag