MVC Razor : Cannot resolve symbol 'model'

With a recent update of Resharper, this started happening in my MVC Razor files. "Cannot resolve symbol 'model'"

Resharper 2019.2.1

VS 2017 & 2019

 

I've tried the following

Tools->Options->Resharper->Suspend and Resume
Resharper Clear Cache restart VS

With the suspend, the error goes away, but as soon as I resume the error returns

With the clear cache, everything looks good when VS restarts, but as soon as the RS cache is rebuilt, the problem comes back. 

This is a solution that is based of Composite C1 (https://c1.orckestra.com/). They use a Website Project for the main project, and if you want to have your own Custom MVC razor controls, you add your own MVC project to the solution.  (https://docs.c1.orckestra.com/Functions/MVC/HelloWorldMVC). The Controllers are built in project, and the Views are in the Website Project. 

To simplify the repro case, created a WebSite project, and added a MVC Project that builds the Model/Controlers. There is a reference to built DLL so the WebSite project can have Views. The same problem will occur when the About.cshtml file is opened in from the WebSite project. Turning Resharper off, and the problem goes away.
https://drive.google.com/file/d/1eQfeOl4pU0zOj2PGONBp5ab_pK9OPJMV/view?usp=sharing 

 

I switched back to Resharper 2018.3.5, and all seems to be working again.


Thank you

0
10 comments
Official comment

Hello,

 

Sorry for the delay in responding.

Unfortunately, it's a known issue - https://youtrack.jetbrains.com/issue/RSRP-471325.

Please feel free to comment or vote for it.

As a workaround please disable ReSharper | Options | Environment | General | Read solution model... option.

Thank you.

Avatar
Permanently deleted user

Thank you for posting the work around. 
Back to coding. 

0

That work around doesn't seem to be working in your 2001.1 release. I am still having this issue and turning the setting on and off makes no change.

0

Hello Kevin Cadd,

 

Is there any chance you could provide the solution that demonstrates the problem? You can share it privately via "Submit a request" form at the top of the page. We can also sign NDA if needed.

Thank you.

0
Avatar
Permanently deleted user

My situation is weird: I have 2 projects in the same solution; in one of them all works OK, in the second one I get the

Cannot resolve symbol 'model'

0
Avatar
Permanently deleted user

the workaround I had was to add 
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="3.1.6" /> to the project (it was not an ASP.NET project)

0

Hello @...,

 

Could you please check if disabling the following option fixes the problem - ReSharper | Options | General | Read solution model directly (please remove the packagereference before)

Please let me know if it helps.

Thank you.

0
Avatar
Permanently deleted user

that was the first thing I tried; no success.

but I was using Razor OUTSIDE of the ASP.NET project - my case was weird. I am using Razor for email templates.

0

Thank you for the reply.

Is there any chance you could provide a sample solution demonstrating the problem?

 

0

Thanks to @... we've reproduced and filed a corresponding issue - https://youtrack.jetbrains.com/issue/RSRP-480778.
Please feel free to comment or vote for it.
Thank you.

0

Please sign in to leave a comment.