Deployed WCF in Windows Azure: One or more role instances are unhealthy. Recycling..Unhandled Exception: System.NullReferenceException?

StackOverflow https://stackoverflow.com/questions/19082535

Question

We have created a WCF service which is working correctly and we deployed it into a Web Role in Windows Azure.

The problem is, When my colleague uses his machine and publishes the service using Visual Studio (Right Click > Publish), Everything works perfectly fine.

BUT, If I am using my machine and I tried to publish exactly the same service (Same source code) using Visual Studio (Right Click > Publish), The deployment gets completed successfully.

Nevertheless, After a few seconds when I check Windows Azure portal, I see that in the Cloud Services section, The WCF status is "! Running", and when I open its Dashboard it states: One or more role instances are unhealthy. 1 Instance: 1 Unhealthy: Recycling (Stabilizing role... Unhandled Exception: System.NullReferenceException [2013-09-29T19:29:30Z])

Why this is happening? I and my colleague have exactly the same source code, But we use different machines.

I checked the following things:

1) I checked and I can confirm that there are not any missing references.

2) I followed Avkash Chauhan's article, and yes, I am using: "Auto-assign Port".

3) I followed Anton Staykov's article, and yes, I set Copy Local: True.

4) Also, I added Sandrino Di Mattia's code as explained on this thread: (AutoStart a WCF on Azure WebRole).

Nothing has worked at all, and I am still encountering the same issue.

So, Could you please help me out to resolve this issue ?

I would greatly appreciate your inputs !

Was it helpful?

Solution

First, find out exactly what is throwing that exception. You can do that by following the troubleshooting series at http://blogs.msdn.com/b/kwill/archive/2013/08/09/windows-azure-paas-compute-diagnostics-data.aspx, in particular the Scenario 1 at http://blogs.msdn.com/b/kwill/archive/2013/08/20/troubleshooting-scenario-1-role-recycling.aspx.

My guess is that you are using a different Azure SDK version than your colleague so you are getting a different service runtime, but there are a lot of things that could cause a generic exception like NullReferenceException.

OTHER TIPS

I would deploy with IntelliTrace turned on and then download/review the logs to see what is throwing the exception.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top