4

We have an Asp.Net 4.5 WebForms application that we still maintain. It uses WebForms with master pages. In VS 2019 the Go to Defintion option is completely missing when I select a form's button event and right-click. The same result when pressing the F12 key which should take me to the method definition for GetTokenButton_OnClick in the code behind page, nothing happens.

This all still works nicely in VS 2017.

Have MS dropped full support for Webforms in 2019 or am I missing an add-on or something?

This is right-click on the button event in 2017: enter image description here

This is 2019> Notice how many functions are missing: enter image description here

UPDATE: I have the same issue with a class library that is part of the same solution. When hitting F12 on any of the class library's objects referred to in the web project's code, I get the dreaded "cannot navigate to symbol under the caret" error. What is strange is that everything builds and executes.

Neville
  • 1,080
  • 1
  • 12
  • 28

2 Answers2

3

I had this issue earlier today after updating to VS2019 and tried all the solutions I found in Go To Definition: "Cannot navigate to the symbol under the caret.". None of those worked, but I solved it by updating the Microsoft.CodeDom.Providers.DotNetCompilerPlatform and Microsoft.Net.Compilers versions in my NuGet Packages for the solution.

  1. Right-Click the solution file and click 'Manage NuGet packages for this Solution'
  2. Under Updates, search for 'compiler'
  3. I updated both Microsoft.CodeDom.Providers.DotNetCompilerPlatform and Microsoft.Net.Compilers to versions that other solutions we maintain use. These were 1.0.8 and 2.4.0 respectively in my case.

After that, definitions and symbols started working again.

  • Thanks for this but it did not fix it for me. Even tried updating both mentioned packages to their latest versions. No difference. – Neville Apr 09 '19 at 10:16
  • 1
    I have the same problem without any dependencies to `Microsoft.Net.Compilers` etc. I am working on a WinForms project. – Kamran Jul 02 '19 at 07:05
0

Believe it or not but I am still maintaining this WebForms app and this now seems to have been resolved. I'm now running Visual Studio Entrerprise 2019 version 16.9.4 and the go-to-definition option is back.

Neville
  • 1,080
  • 1
  • 12
  • 28