Solution-Wide Analysis Explained
As announced before, ReSharper 3.1 provides a new full-fledged feature called Solution-Wide Analysis, which looks for erroneous C# code in your solution on-the-fly, without compiling it first.
So how does it work?
Suppose that you changed the visibility of a member from public to internal, assuming that it was only used inside the current assembly. At this stage, ReSharper finds no errors in the current file. Then, you switch on Solution-Wide Analysis and the circle indicator in the status bar turns red. You jump to the next error in solution and you find out that someone used this member from outside of the current assembly. You make necessary amendments, and that’s all! No need to compile, then look for errors, then fix them, and finally repeat the whole process over and over again.
Initial analysis may take some time to complete while you continue your work, but after it is done, only files that can potentially be affected by recent changes are reanalyzed.
Note that this feature is disabled by default and should be explicitly configured for every new solution you use.
To switch Solution-Wide Analysis on, just double-click the gray circle in the right corner of the status bar. After that, when the Solution-Wide Analysis tab displays in the Options dialog box, select Analyze errors in whole solution.
Switching on Solution-Wide Analysis is signified by several changes in UI:
- The circle indicator in the right corner of the status bar displays the progress of Solution-Wide Analysis. Initially, it is gray, but after analysis is complete, the indicator turns either green (if no solution-wide errors were found) or red (if errors were detected).
- A small area to the left of the circle indicator is allocated to show the number of solution files that contain errors, if any.
- Names of several Go to commands are extended. Specifically, Go to Next Error changes to Go to Next Error in Solution and Go to Previous Error becomes Go to Previous Error in Solution.
To view the list of errors found in solution, double-click the circle indicator. The Errors in Solution window opens where you can view the list of detected errors and navigate to them in code by double-clicking their respective descriptions.
Even without opening that window, you can still easily navigate through errors in your solution with Go to Next Error in Solution (Alt+Shift+Page Down or Alt+F12) and Go to Previous Error in Solution (Alt+Shift+Page Up or Shift+Alt+F12) commands.
You might also like to know what others have to say about this wonderful new feature:
Brian Di Croce reviews ReSharper 3.1
Ilya Ryzhenkov, .NET Tools Product Manager at JetBrains, reviews an earlier version of Solution-Wide Analysis and answers your questions
Jonas Bandi emphasizes the role of Solution-Wide Analysis as a means to differentiate between developing and building solutions. So do Jean-Paul S. Boodhoo and Joey Beninghove.
Subscribe to Blog updates
Thanks, we've got you!
Visualize Entity Framework Relationships and Additional Query Analysis in ReSharper 2023.3
A lot of teams are using Entity Framework or EF Core to work with their database. As an Object-Relational Mapper (ORM), it bridges objects in code to a relational database model, so that as a developer you don’t have to worry too much about the actual database. We all know: that’s not entirely tr…
Automatically Analyze ASP.NET Core Performance With Dynamic Program Analysis
Slow web pages may make your users or customers abandon your web application, even before they’ve had a proper look at it. You’ve likely also been frustrated working with a web application that is slow to load. The good news is that the latest versions of ReSharper and JetBrains Rider’s Dynamic P…
OSS Power-Ups: MassTransit – Webinar Recording
The recording of our webinar, OSS Power-Ups: MassTransit, with Chris Patterson, is available. This was the thirteenth episode of our OSS Power-Ups series, where we put a spotlight on open-source .NET projects. Subscribe to our community newsletter to receive notifications about future webinars.…
Eager, Lazy and Explicit Loading with Entity Framework Core
Entity Framework Core (EF Core) supports a number of ways to load related data. There’s eager loading, lazy loading, and explicit loading. Each of these approaches have their own advantages and drawbacks. In this post, let’s have a quick look at each of these ways to load data for navigational prope…