Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Resharper code analysis outside of Visual Studio

Resharper includes various analysis rules which can be run on your solution from inside Visual Studio but is it possible to run these from say the commandline or as part of your autobuild? Resharper seems to be focused on running in Visual Studio but can it be invoked on solution or project files from outside the IDE?

UPDATE: Seems like TeamCity 7.0 EAP includes a way to execute the code-analysis while building (blog post) so at least it can somehow be invoked and utilized as part of a CI process.

like image 272
soren.enemaerke Avatar asked Jun 02 '09 20:06

soren.enemaerke


2 Answers

No, this feature is not currently offered by ReSharper. There is a thread on the JetBrains website related to this question and it can be found here.

Here's a quote:

Currently ReSharper has no interface from running in a standalone batch application. However, it is possible to write such an application that provides the functionality you're looking for using ReSharper OpenAPI.

So apparently you could use the ReSharper OpenAPI to create the functionality you want; unfortunately, I haven't had any experience in using it so I'm not much help there.

Some links of interest...

ReSharper OpenAPI Developer Community
ReSharper public API and sample source code (aka. ReSharper PowerToys)

like image 66
Steve Dignan Avatar answered Sep 17 '22 20:09

Steve Dignan


I think you want the functionality provided by fxCop. I am not aware of Resharper functioning outside of Visual Studio.

like image 29
Matthew Vines Avatar answered Sep 17 '22 20:09

Matthew Vines