5

I have a project, that uses my own nuget package from my nuget feed. I've set up a source server in devops, so I'm able to step into the code inside this package by pressing F11.

But also I'd like to be able to jump to this code using Ctrl+F12 (go to implementation). Now when I try this, I get "The symbol has no implementations".

Is it possible?

Flutter
  • 93
  • 8

1 Answers1

0

VisualStudio: Find implementation inside my nuget package

I am afraid there is no such out-of-box way to do this at this moment.

As we know, the symbol server is used for debugging. We could step into the source code by the Debugger and symbol.

But if we use Ctrl + F12 directly from your code, it would only search for implementations in your code. It does not invoke the debug mechanism, so it can not find the implementation in the nuget package, even if we provide the symbol server.

So, if you still want to find implementation inside nuget package, as workaround, you can try to add the source code into the reference project, we could include the source code in to the content folder in the .nuspec file,like:

<files>
  <file src="TestDemo.cs" target="content\Implementation" />
</files>

In this case, the source code will be added to the reference project, we could use Ctrl+F12 to find implementation.

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • Sorry, I am not sure I understand how to include source in nuspec. Could you please advise? – Flutter Sep 12 '19 at 09:06
  • @Flutter, Okey, As I said in my answer. We could not do it directly. In order to add the source code into the reference project, we need to create a `.nuspec` file and use it to create a nuget package, in the `.nuspec` file add above code in it. Check the document: https://learn.microsoft.com/en-us/nuget/create-packages/creating-a-package and my another thread: https://stackoverflow.com/questions/43277715/create-nuget-package-from-dlls/43316056#43316056 for some more details. **Note** the target folder should be ***content*. – Leo Liu Sep 12 '19 at 09:14