5

TL;DR;
I would like to know if theres a way to go to the "real" implementation of a method, instead of the "reference" of it.

Long Version
So, for most of us, referencing a asmx/svc web-service is quite a common scenario.

When you do so, VS generates a proxy in the consuming project/s.

We also are usually developing both the client and the service, which put us more often than not in the scenario where you want to check some info about the service method implementation, but when you hit F12, you're taken to the very useless VS generated code.

I would like alter that behavior, and, instead of being referred to the auto-generated code I want the real implementation to show up.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
Leonardo
  • 10,737
  • 10
  • 62
  • 155
  • 1
    related: http://stackoverflow.com/questions/21548142/any-way-to-apply-an-exclude-list-to-the-visual-studio-navigate-to-list – DLeh Apr 20 '15 at 13:23
  • 1
    That *is* the real implementation. On the client side you have a proxy generated from a WSDL that makes the calls to the server and a set of DTOs. Perhaps you mean how to navigate to the *server* code? There's no connection from the WSDL to the server side code that implements it. The implementation may be in Java, PHP or C++. You can debug from the client to the server only when VS has control of both ends, either because it runs both ends or the remote server is set up for remote debugging. – Panagiotis Kanavos Apr 20 '15 at 13:26
  • Short answer: No visual studio doesn't offer this feature. Some plugins like Resharper can get you closer to the desired way of working. – jessehouwing Apr 20 '15 at 13:29
  • @DLeh I don't think this is relevant, the OP asks how to navigate to server-side code from the client – Panagiotis Kanavos Apr 20 '15 at 13:29
  • @jessehouwing I don't think Resharper can navigate to server-side code from a service client. – Panagiotis Kanavos Apr 20 '15 at 13:30
  • 2
    It might be possible to create an Visual Studio extension that will take you to the server implementation if it's somewhere in the same solution. The extension would have to "guess" at the correct function, so it might not be totally reliable. I quick Google search didn't bring back any existing extensions unfortunately. – Bradley Uffner Apr 20 '15 at 13:30
  • 2
    If the underlying interface definition is shared between client and server (depending on how you generate the proxy, this is possible), then Resharper can navigate to the different implementations of the interface. – jessehouwing Apr 20 '15 at 13:31
  • @Leonardo also note that the proxy is neither useless nor completely autogenerated. You can modify it in a *lot* of places to take care of various scenarios, eg. make changes to the serialization logic, use custom message formatters etc. – Panagiotis Kanavos Apr 20 '15 at 13:33

1 Answers1

1

You won't be able to achieve that in Visual Studio. But in ReSharper there is "Go to Implementation" command, or Ctrl + Shift + Alt + B.

PiotrWolkowski
  • 8,408
  • 6
  • 48
  • 68