How to make ReSharper re-evaluate its assembly ref

2019-01-12 14:50发布

I am creating a Prism Project Template, and the template works great. But after I create a project with the template some of the files look like this:

Bad References

Despite appearances, everything is just fine.

If I do a Rebuild All I see that the solution builds with no errors:

Rebuilt

But the rebuild all does not get rid of the "errors" that are showing in the editor window. (Note that the actual error window does not show any errors.)

I can clean, rebuild, close and open files, and it will not fix the highlighting.

However, if I close the solution and re-open it, all is well:

Works After Reload

My Question:

Ideally there would be a way for my template or my IWizard to tell ReSharper to reload the references for the highlighting.

I know I can turn ReSharper off and then on again and that will fix it, but I would rather not do that.

Is there a ReSharper command that just refreshes this stuff?

14条回答
等我变得足够好
2楼-- · 2019-01-12 15:35

Go to ReSharper → OptionsGeneral and click Clear Caches. (I have 8.2, so if you're on a different version it may be elsewhere.)

You'll then need to re-open your solution, and ReSharper will re-analyse everything.

查看更多
【Aperson】
3楼-- · 2019-01-12 15:37

If the solutions above don't work you can try resetting the project output type. This seems to fix the issue on VS2015 Update 1 with ReSharper 10.1

查看更多
登录 后发表回答