5

In Visual Studo, if you have the "Enable navigation to decompiled sources" option enabled, and you select "go to definition" on some identifier for which you do not have the source code, you receive a dialog like this:

enter image description here

The text of the above dialog, for the benefit of search engines:

IMPORTANT: Visual Studio includes decompiling functionality ("Decompiler") that enables reproducing source code from binary code. By accessing and using the Decompiler, you agree to the Visual Studio license terms and the terms for the Decompiler below. If you do not agree with these combined terms, do not access or use the Decompiler.

You acknowledge that binary code and source code may be protected by copyright and trademark laws. Before using the Decompiler on any binary code, you need to first: (i) confirm that the license terms governing your use of the binary code do not contain a provision which prohibits you from decompiling the software; or (ii) obtain the permission to decompile the binary code from the owner of the software.

Your use of the Decompiler is optional. Microsoft is not responsible and disclaims all liability for your use of the Decompiler that violates any laws or any software license terms which prohibit decompiling of the software.

I agree to all of the foregoing: [Yes] [No]

The problem is, I see this dialog way more often than I should. I would expect to only see it once per user, per installation of Visual Studio; instead, I see it several times per working day.

Is this expected behavior? If not, what could be causing this? If yes, how can it be permanently disabled / circumvented / thwarted / botched / hacked out of existence?

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
Mike Nakis
  • 56,297
  • 11
  • 110
  • 142
  • 3
    ... Lawyers ... – Mike Nakis Jun 28 '19 at 08:31
  • Update: after a month or so the annoying dialog stopped popping up. On its own. Without me having done anything to cause this. At least not knowingly. – Mike Nakis Nov 01 '19 at 20:58
  • 2
    I really feel the pain too. I open and close projects like a thousand times a day and it keeps poping up every single time. Would really helpful if anyone finds any way to disable it completely forever. – thienhaflash Dec 12 '20 at 14:22

1 Answers1

1

Unfortunately, I think this requires some VS-dll manipulation. The option seems to be in the following dll:

{Disk}:\Program Files (x86)\Microsoft Visual Studio\{VS-version}\Enterprise\Common7\IDE\CommonExtensions\Microsoft\ManagedLanguages\VBCSharp\LanguageServices\Microsoft.VisualStudio.LanguageServices.dll

But it seems that the service is invoked each time and saved only in memory, not in any settings:

enter image description here

Then we go:

enter image description here

And ultimately here:

enter image description here (decompiled with dotPeek)


There's similar warning in VS Code, to disable it there:
Replace the function next to registerCommand("csharp.showDecompilationTerms"
with function(){}
in ~\.vscode\extensions\ms-dotnettools.csharp-{version}\dist\extension.js.

Like on the following picture: enter image description here

Mr Patience
  • 1,564
  • 16
  • 30