Cannot resolve symbol after updated to Visual Studio 15.4.0

In my views (*.cshtml (asp.net mvc)) the .net types, used within the razor-syntax shows the message 'cannot resolve symbol'.

If I suspend the 'Resharper Extension', it looks fine and the .net types can be resolved.

Any ideas?

 

Regards,

Oliver

 

 

2
8 comments

Hello Oliver!

 

Thank you for contacting us.

Could you please specify in  what kind of project the problem occurs (Core/.Net Framework version)?

Is the issue reproduced in a newly created solution?

Also some screenshot illustrating the issue will be appreciated.

Thank you.

 

0
Avatar
Permanently deleted user

Hi Angelina

Currently I can't reproduce this scenario.

Sometimes the view can not resolve the .net types like the 'Model' or the 'IHtmlHelper', sometime it works.

Sometime when I close my view and reopen it again, it works again.

Or sometime I suspend Resharper and resum again it work as well.

Following settings I have:

- Asp.Net MVC with Target Framework .Net Core 2.0
- Visual Studio Enterprise Version 15.4.0

At the moment it's not a real bug I think.

I still can work and life with it.

But this problem (cannot resolve symbol) I see a lot. Last time I could fix it, after I installed a new Resharper version.

Here is also a screenshot, that you know better, what I'm talking about.


If you have more questions just let me know.

Best regards,
Oliver

0

Hello Oliver!

 

Thank you for the reply.

Seems to be similar to the following issue - https://youtrack.jetbrains.com/issue/RSRP-465693.

Thank you.

0
Avatar
Permanently deleted user

Verifying this issue exists in R# 2017.3 EAP 4 on VS 2017 on a .NET 4.5 project.  (The issue you linked in RSRP-465693 looks to be dealing with controller code not views, but they could be related.)  @section and other Razor syntax shows the following:

UPDATE: Error also exists opening the same project in VS2015.

0

Hello Chrisp12934!

 

Thank you for the feedback.

Could you please provide some demo solution so we could reproduce the issue?

Thanks in advance!

0
Avatar
Permanently deleted user

I think I have found an issue.  I have 2 files in the same project, one shows the error described above but one does not.  In comparing these side-by-side, it appears that the comment format in the Razor block above the @section is triggering the issue.  See the 2 screenshots below for the detail:

 I can cause the same issue if I put a Razor section such as @functions{} below the "Begin block:" comment.  This is resolved if I split that comment into multiple lines.

0
Avatar
Permanently deleted user

Additional info:  It appears to be related to the number of asterisks in the trailing section of the comment block.

This happens even if the trailing comment indicators are on the next line:

0

Hello Chrisp12934!

 

Thank you for the provided info.

I've filed corresponding issue - https://youtrack.jetbrains.com/issue/RSRP-467040

Please feel free to comment or vote for it.

0

Please sign in to leave a comment.