I am sorry, I am not able to provide you with a sample solution that the problem.
I have found a way to fix it temporarily, but it is kind of inconvenient as it has to be done everything I start Visual Studio.
What I do is basically I suspend Resharper after I have opened my solution, then I resume it. Then I have to proceed to open every file with errors so, and wait for Resharper to scan them and correctly analyse the file as without error. Resharper is not aware of the Razor views until I open the file for inspection.
The latest EAP build doesn't fix the issue. I have also tried installing older builds of Resharper, and found 2017.1 to be working perfectly. With everything correctly analysed.
Nope, I don't have any custom view locations in my solution, they are all mostly created with the help of Resharper, only exist in the View folder, and structured according to their controller name.
I don't have any custom Razor engine installed or used by my solution.
Resharper indicates that that it "Can't create view".
I am having the same issue VS2017 using ReShaper Ultimate 2017.1.3. The project is using csproj with no custom view locations and default razor engine. Alt+Enter results in "can't create view" message.
I have this same issue too. Running version 2017.1.3 with VS 2017.2, and .NET Core 1.1 (csproj). I've sent a request with a solution for you to look at.
It's just a new MVC template project, nothing changed. Also I've noticed this bug does not affect Rider with the same project. I'm not sure if that would be useful information or not.
Update: I've tried restarting VS and reloading the solution. In both cases they come out with inconstant results. Sometimes the bug goes away and others it stays. I should also add that if you Alt+Enter and try to create a view it says "Can't create view". That error is displayed with every "Create View" option. Also resetting my settings doesn't seem to help either,
This bug is fixed in Rider 2017.2.1, which will be released in few weeks. The workaround is to install current stable Mono 5.4., invalidate caches and restart Rider (File->Invalidate caches/Restart).
I'm getting this same issue with a vanilla project on a mac.
I'm running:
mac High Sierra (10.13)
Rider 2017.2
dotnet --version is 2.0.2
If I create a brand new project (dotnet new mvc -o MyApp) and open the csproj in Rider, it will immediately highlight all the View calls in the HomeController saying it can't find the view.
Additionally if you try to create the view via Option-Enter, you get the red error "Can't create view".
This happens on both macbook pros I have.
Edit: I note in the referenced bug above that it's reproducible on Mac when Mono isn't installed (this is the case on both my machines). So I shall wait for 2017.2.1 to see if that fixes it.
I'm having the same problem in my ASP.NET MVC 4 project. The project is very large and ReSharper is reporting that there are 1220 errors in the project, all reporting Cannot resolve view 'Blah'. I can't navigate to my views from the controller.
Running:
VS2017 (v15.5.6)
ASP.NET and Web Tools 2017 (v15.0.31127)
ReSharper Ultimate (v2017.3.2)
Please let me know if you need more information. Thanks for any guidance.
No, unfortunately this did not solve the problem for me either. I followed all the steps reported by the various commenters, but still to no avail. I'd be happy to do a screenshare if someone from JetBrains is interested in troubleshooting the problem with me. I've spent a LOT of time trying to fix this issue but nothing seems to work.
Hello
Are you able to reproduce the same issue in a newly created project?
What ReSharper version do you have installed?
Thanks!
I am having similar issue on my MVC Core application, using Resharper 2017.1.3
@Lewis,
could you please provide us some sample solution introducing the issue? You can do it privately by using 'Submit a request' form.
Thanks in advance!
@Angelina Elycheva,
I am sorry, I am not able to provide you with a sample solution that the problem.
I have found a way to fix it temporarily, but it is kind of inconvenient as it has to be done everything I start Visual Studio.
What I do is basically I suspend Resharper after I have opened my solution, then I resume it. Then I have to proceed to open every file with errors so, and wait for Resharper to scan them and correctly analyse the file as without error. Resharper is not aware of the Razor views until I open the file for inspection.
Thank you for the reply, Lewis!
Could you please try to install the latest ReSharper 2017.2 EAP build - https://www.jetbrains.com/resharper/eap/ and check if the problem is still reproduced?
Thank you.
@Angelina Elycheva,
The latest EAP build doesn't fix the issue. I have also tried installing older builds of Resharper, and found 2017.1 to be working perfectly. With everything correctly analysed.
Thank you for the feedback, Lewis!
Coudl you please provide the following information:
Thanks in advance!
Hi @Angelina Elycheva
Regarding your questions:
Thank you for the reply, Lewis!
Could you please specify the following information:
Thank you!
Hi @Angelina Elycheva,
Alrighty. Here you go!
Thank you for the information!
Just one more question, what type of project is used: xproj or csproj?
Thanks in advance!
I am having the same issue VS2017 using ReShaper Ultimate 2017.1.3. The project is using csproj with no custom view locations and default razor engine. Alt+Enter results in "can't create view" message.
@Angelina Elycheva
It is .csproj
Lewis, Alonso,
thank you for the information.
Unfortunately it's still quite hard to troubleshoot the issue without any sample solution.
We'll be very grateful if you could provide the solution on which the issue could be reproduced. We can sign NDA if needed.
Same issue here. Willing to throw in a hand if useful to debug/fix.
Hello @Jrtd!
Could you please provide the problem solution so we could reproduce the issue?
Thank you.
@Angelina Elycheva
I have this same issue too. Running version 2017.1.3 with VS 2017.2, and .NET Core 1.1 (csproj). I've sent a request with a solution for you to look at.
It's just a new MVC template project, nothing changed. Also I've noticed this bug does not affect Rider with the same project. I'm not sure if that would be useful information or not.
Update: I've tried restarting VS and reloading the solution. In both cases they come out with inconstant results. Sometimes the bug goes away and others it stays. I should also add that if you Alt+Enter and try to create a view it says "Can't create view". That error is displayed with every "Create View" option. Also resetting my settings doesn't seem to help either,
So it turned out that ReSharper 2017.2 EAP build resolved issue for Travis.
If you experience such problem please try to install the latest build - https://www.jetbrains.com/resharper/eap/
Thank you.
Hi Angelina,
I did. But the problem sort of comes back randomly.
Most of the times, it is ok, but there will be that one time, where it just fails, and I have to redo steps I mentioned to get it to analyse properly.
I'm having the same problem in Rider. Should I submit a ticket? I would be willing to share the project.
Hello Awang117!
You can upload the project using 'Submit a request' form.
Please also attach screenshots illustrating the issue.
Thanks in advance!
In Rider is very simple to reproduce, just download the okta sample from here https://github.com/oktadeveloper/okta-aspnetcore-mvc-example and you will notice that all View() are highlighted as errors.
Running Rider in linux but this should not make any difference.
Hello Awang117, Calin
This bug is fixed in Rider 2017.2.1, which will be released in few weeks. The workaround is to install current stable Mono 5.4., invalidate caches and restart Rider (File->Invalidate caches/Restart).
Hi
I have this issue with brand new ASP.NET Core Web Application.
This line in ManageController.cs (114):
return View(model);
JetBrains ReSharper Ultimate 2017.2.2 Build 109.0.20171006.122324
ReSharper 2017.2.20171006.123800
Hi,
I'm getting this same issue with a vanilla project on a mac.
I'm running:
If I create a brand new project (dotnet new mvc -o MyApp) and open the csproj in Rider, it will immediately highlight all the View calls in the HomeController saying it can't find the view.
Additionally if you try to create the view via Option-Enter, you get the red error "Can't create view".
This happens on both macbook pros I have.
Edit: I note in the referenced bug above that it's reproducible on Mac when Mono isn't installed (this is the case on both my machines). So I shall wait for 2017.2.1 to see if that fixes it.
I'm having the same problem in my ASP.NET MVC 4 project. The project is very large and ReSharper is reporting that there are 1220 errors in the project, all reporting Cannot resolve view 'Blah'. I can't navigate to my views from the controller.
Running:
Please let me know if you need more information. Thanks for any guidance.
Hello Lucas!
Thank you for the feedback.
First of all, could you please try suggestion from the following help article?
Thank you.
Thank you for the response. :)
No, unfortunately this did not solve the problem for me either. I followed all the steps reported by the various commenters, but still to no avail. I'd be happy to do a screenshare if someone from JetBrains is interested in troubleshooting the problem with me. I've spent a LOT of time trying to fix this issue but nothing seems to work.
Thanks for any help!
Luc
Hello Lucas!
Thank you for the reply.
Is there any chance you could provide the problem solution? We can sign NDA if needed.
Thank you.
Yes, please provide me with an email address and I can zip it up and send it over (it's big).