- Home /
- Visual Studio /
Shivji Patel reported Mar 26 at 08:28 AM
When opening an exiting solution in VS2019 RC that uses ASP.NET MVC and try doing go to difinition F12 or go to difinition we get Cannot navigate to the symbol under the caret, if you open the solution in VS2017 all works fine
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
This issue has been identified as a duplicate of an earlier reported feedback linked here: https://developercommunity.visualstudio.com/content/problem/381747/cannot-navigate-to-the-symbol-under-the-caret-vs-1.html . If you reported or voted here, your vote has been applied to the original issue. Everyone else can add their vote directly at the above linked feedback. Voting helps increase the priority of the issue by consolidating customer impact under one feedback. Thank you!
I'd like to ask you if you can help us get some extra logging information for your project to help us diagnose these issues. The instructions are available at:
https://github.com/dotnet/roslyn/wiki/Diagnosing-Project-System-Build-Errors
If you could follow the steps under "How do I get log files to diagnose what is happening in Visual Studio 2019?" and could attach the resulting logs to this feedback item, that would be greatly appreciated. Thanks!
The feedback you just closed contains some attachments, i hope that can give some help :)
The bug originally landed on me but it's not something I can drive the fix for. I've just been looking at attachments to confirm the issue it the same as this one, but will let the other team actually drive the issue to resolution.
FWIW, I think I've reported the same issue over here: https://developercommunity.visualstudio.com/content/problem/520524/not-getting-design-time-build-information-for-one.html
Thanks for connecting the dots on these @Jason Malinowski [MSFT]
Would it be possible for someone to share their source code? I am trying to reproduce this issue to validate a workaround.
We need access to source that will reproduce this issue. Would it be possible for you to share your source code?
What kind of source code? Any ASP.NET MVC source code?
@Juan José Mejia [MSFT] I was able to create a minimal repro at https://github.com/daveaglick/VS2019Test
This is happening to projects that are using v1.0.0 of Microsoft.Net.Compilers. To work around this problem you need to update to the latest stable version which is 3.0.0. To do that you can follow the these steps:
1) Right click on "References" in the Solution Explorer
2) Select "Manage NuGet Packages"
3) Under the "Installed" tab search fro "Microsoft.Net.Compilers"
4) Select "Microsoft.Net.Compilers"
5) On the side window of "Microsoft.Net.Compilers" click the update button
That should allow you navigate to definitions
This is the same step to resolve the issue in https://developercommunity.visualstudio.com/content/problem/515168/visual-studio-2019-release-go-to-definition-doesnt.html
Can we get something built into VS 2019 to help deal with this situation as these types of projects will still build fine but Intellisense is completely broken?
A fix for this issue has been internally implemented and is being prepared for release. We'll update you once it becomes available for download.
Solution by Juan José Mejia [MSFT] · Apr 08 at 07:55 PM
This is happening to projects that are using v1.0.0 of Microsoft.Net.Compilers. To work around this problem you need to update to the latest stable version which is 3.0.0. To do that you can follow the these steps:
1) Right click on "References" in the Solution Explorer
2) Select "Manage NuGet Packages"
3) Under the "Installed" tab search fro "Microsoft.Net.Compilers"
4) Select "Microsoft.Net.Compilers"
5) On the side window of "Microsoft.Net.Compilers" click the update button
That should allow you navigate to definitions
FWIW, I was able to get back up and running by upgrading to Microsoft.NetCompilers v1.1.0. That appears to be working okay and is a little less risk IMO since mine is a legacy application in maintenance and we try to avoid major version updates.
This doesn't help my situation. I don't have any NuGet packages in the project which is having these issues.
In my case, its a solution with a couple of dll's. One of them has project references to two others and even though it compiles and runs, the project references are ignored in the IDE and are shown as unknown. Additionally, any type or method from those reference is shown as unknown and cannot be navigated to.
Unfortunately, I am unable to upload the code to demonstrate it.
However, it works fine in VS 2017 and has this problem in VS 2019.
If you don't have any NuGet packages then you're seeing something else. I'd suggest you create a new feedback item so we can investigate that separately. Do still follow the steps at https://github.com/dotnet/roslyn/wiki/Diagnosing-Project-System-Build-Errors to get the logs so we can investigate, and feel free to tag me in the description.
Thanks Jason. Rather than creating a new problem, I found this one
https://developercommunity.visualstudio.com/content/problem/524877/intellisense-not-working-cannot-navigate-to-the-sy.html
which was recently created and seems to be the same and attached my logs there.
This solution worked for me as well. I learned that I can't assume that an existing project is automatically going to work in a new version of a tool. We must always remember that many tools' features are dependant on packages (either extensions or NuGet packages). Thanks for the solution and keep on keepin' on.
David
It is something we try for! This is something that unfortunately slipped through testing. :-(
What are we supposed to do if the project is a asp.net webform project that does not have any version of "Microsoft.Net.Compilers" installed?
File a new feedback item, since you're seeing something else we'll need to investigate. (Trying to keep track of multiple, separate issues in one feedback item gets confusing really quick!) Do still follow the steps at https://github.com/dotnet/roslyn/wiki/Diagnosing-Project-System-Build-Errors to get the logs so we can investigate.
I went into manage nuget packages but it did not show "Microsoft.Net.Compilers".
what worked for me was to edit the .vbproj file
in there I found the following two lines, removing them fixed the go to definition problem
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" /> <Import Project="..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
Ah, so do you not have a packages.config that listed those? Then somehow your project may have gotten corrupted during some past change.
one thing for sure is that this seems to be a project based issue and not a problem with visual studio 2019. This is a good thing as all of the fixed seen to be an adjustment to one of the projects various configuration files/options.
This is ultimately the solution that worked for me.
Thanks. Worked for me vs community 2019
Solution by Narasimha Trinadh Nemani · 8 hours ago
Worked for me. You saved some time. Thanks
180 People are following this
Intellisense cannot handle Boost anymore
0 Solution
Target Framework won't change (preview)
1 Solution
Integration tests(HostType("VS IDE")) are not worked in vs2019.
0 Solution
Problem with Docker installation by Visual Studio 2019
0 Solution
打开时候直接卡死-Just stuck when you open it.
0 Solution
VS Open my solution with Active Solution Platform as ANY CPU instead of x86
0 Solution
WPF controls can not load design-time assemblies in ToolBox in VS2019 RC
0 Solution