0

I have a problem with WCF. My testing code is pretty simple.

I call a service layer method on my server from my silverlight application and print the result in a textbox.

Everything of this is surrounded by try-catch.

When my service layer method simply returns a constantly defined string there seems to be no problems - however as soon as it calls a more complex method it fails.

While debugging it does not even reach the complex model method; it fails before that inside some auto-generated code from microsoft:

/WuSIQ.jpg

As the error message "NotFound" is not exactly the most helpful or specific you can imagine my trouble googling for hints.

I thought maybe the auto-generated code could only send simple data so I made a temporary string and returned that, but this did not help.

I have already: a client access policy, a service reference added, removed duplicate reference in ServiceReferences.ClientConfig and a ServiceLayer.svc.cs.

I am debugging by running from the main window and my breakpoints are picked up.

Anyone?

pnuts
  • 58,317
  • 11
  • 87
  • 139
Martin Clemens Bloch
  • 1,047
  • 1
  • 12
  • 28
  • Okay so I found out I had overlapping problems, namely that my server side "model" code was not being debugged - on top of the NotFound error, which caused confusion. Relying on this post I solved this isolated issue: http://stackoverflow.com/questions/732674/when-debugging-asp-net-mvc-app-breakpoints-are-not-hit – Martin Clemens Bloch Mar 18 '12 at 12:52
  • The problem was an HTTP timeout exception occurring inside WCF code. It was only triggered when I called a heavy method (dynamically compiling an assembly and saving it) on the server. Running on a faster computer made it less frequent, confusing! I'll have to set the time limit more appropriately. – Martin Clemens Bloch Mar 18 '12 at 14:06

1 Answers1

0

I had some errors in the server side method that were quickly found after debugging was fixed.

I fixed this, as I said in comments, setting the project to have "Multiple Startup Projects".

Whenever I had troubles with updating the WCF service methods one of these usually solved it all:

1 Delete all bin and obj folders (specifically selecting re-build might do the same).

2 The servicelayer will not succesfully auto-update (but will work!) unless this:

[ServiceContract(Namespace = "")]

... is set to this:

[ServiceContract(Namespace = "YourServiceLayerName")]

3 Right clicking on the servicereference and selecting "update...".

Sometimes it would stop debugging again, but a forced full re-build would return it to normal.

I hope this helps someone.

Martin Clemens Bloch
  • 1,047
  • 1
  • 12
  • 28