question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

F1 context doesn't include TargetFrameworkMoniker

See original GitHub issue

When invoking help in the code editor, the current target framework isn’t correctly forwarded.

In a .NET Framework 4.5 (old-CSPROJ) invoking F1 on Console.WriteLine yields this URL:

https://docs.microsoft.com/en-us/dotnet/api/system.console.writeline?f1url=https%3A%2F%2Fmsdn.microsoft.com%2Fquery%2Fdev16.query%3FappId%3DDev16IDEF1%26l%3DEN-US%26k%3Dk(System.Console.WriteLine);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.5);k(DevLang-csharp)%26rd%3Dtrue&view=netframework-4.8

Invoking F1 in an SDK-style projects yields this URL:

https://docs.microsoft.com/en-us/dotnet/api/system.console.writeline?f1url=https%3A%2F%2Fmsdn.microsoft.com%2Fquery%2Fdev16.query%3FappId%3DDev16IDEF1%26l%3DEN-US%26k%3Dk(System.Console.WriteLine);k(DevLang-csharp)%26rd%3Dtrue&view=netframework-4.8

Notice how k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.5); is missing from the query string.

Currently, there is also a bug where the docs ignore the TargetFrameworkMoniker keyword: https://github.com/dotnet/docfx/issues/5183, so we should coordinate the change with them. The end-to-end we’re going for is that the help filter on the landing page matches the current target framework. In a multi-targeted project, we probably want to honor whatever is currently selected in the top left drop down (i.e. the IntelliSense context).

VS Version

Microsoft Visual Studio Enterprise 2019 Int Preview Version 16.4.0 Preview 2.0 [29402.240.master] VisualStudio.16.IntPreview/16.4.0-pre.2.0+29402.240.master Microsoft .NET Framework Version 4.8.03921

Installed Version: Enterprise

Application Insights Tools for Visual Studio Package 9.1.00913.1 Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2019 16.4.269.3342 ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019 16.4.269.3342 For additional information, visit https://www.asp.net/

AssemblyInfo Wizard 1.0 AssemblyInfo Wizard

Azure App Service Tools v3.0.0 16.4.269.3342 Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 16.4.269.3342 Azure Functions and Web Jobs Tools

C# Tools 3.4.0-beta2-19476-01+5ca953892a00380dd9e5d49d13f1d33a240a0005 C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GitHub.VisualStudio 2.10.7.8114 A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

IntelliCode Extension 1.0 IntelliCode Visual Studio Extension Detailed Info

Microsoft Azure Tools 2.9 Microsoft Azure Tools for Microsoft Visual Studio 0x10 - v2.9.20905.5

Microsoft Continuous Delivery Tools for Visual Studio 0.4 Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 2.0.87+gbb515bf382 Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio Tools for Containers 1.1 Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

NuGet Package Manager 5.4.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info

Snapshot Debugging Extension 1.0 Snapshot Debugging Visual Studio Extension Detailed Info

SQL Server Data Tools 16.0.61910.01140 Microsoft SQL Server Data Tools

TypeScript Tools 16.0.10926.2001 TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.4.0-beta2-19476-01+5ca953892a00380dd9e5d49d13f1d33a240a0005 Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.4 for F# 4.6 16.4.0-beta.19475.4+e8b20b093d75f5050d805d10f9fe93dc57701347 Microsoft Visual F# Tools 10.4 for F# 4.6

Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions (Preview) 1.0 View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for Containers 1.0 Visual Studio Tools for Containers

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
davidwengiercommented, Dec 10, 2019

Based on the link to the legacy implementation, what we need here is something like the following:

  • CPS needs to respond to the VSHPROPID_UserContext with information it knows (like project, project item)
  • CPS needs a new extension point so that extenders can add data to the context (allowing for multiple extenders in some fashion)
  • We need an implementation of that extension point that adds TargetFrameworkMoniker and/or anything else we need
1reaction
davkeancommented, Nov 8, 2019

Okay this is actually a pretty big work item, CPS basically doesn’t support setting any “help context” at all, so the feature will be adding the ability to CPS to respond to VSHPROPID_UserContext for all nodes in a tree, and then have each node in the solution tree respond to this in the same way that legacy does, see GetUserContext usage under src/vsproject.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio intercepting F1 help command
About 10 years ago, when I worked at Microsoft, I wrote the specification for the original "Online F1" feature in Visual Studio 2005....
Read more >
Microsoft Help Viewer SDK - Visual Studio (Windows)
This is the value that is matched to the F1 call from within the IDE to display this topic when F1 is chosen...
Read more >
Announcing .NET 6 - The Fastest .NET Yet - .NET Blog
The net6.0 Target Framework Moniker (TFM) gives you access to all the cross-platform APIs that .NET offers. This is the best option if...
Read more >
Search DevExpress documentation from Visual Studio not ...
I have attached a small sample which is a very simple web forms application (it has no DevExpress stuff in it). If I...
Read more >
Entity Framework - RSSing.com
Next Created Unassigned: EF5 F1 Help missing a space between words [1175] ... Context.tt already exists' -- Designer attempts to add template when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found