soren.enemaerke
soren.enemaerke

Reputation: 4830

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.

Upvotes: 8

Views: 1790

Answers (5)

Tao
Tao

Reputation: 13986

Looks like they're listening! First version available as a 30-day demo now: http://blogs.jetbrains.com/dotnet/2013/03/resharper-code-analysis-goes-beyond-visual-studio/

Upvotes: 2

Troy Hunt
Troy Hunt

Reputation: 20387

If you're looking for compliance of code to standards, take a look at StyleCop. You can tie it into msbuild and run the rules outside of the IDE.

Upvotes: 1

Steve Dignan
Steve Dignan

Reputation: 8530

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)

Upvotes: 9

tanascius
tanascius

Reputation: 53924

No, it can not be run from commandline. I still hope that they add this feature since I requested it last october :)

Upvotes: 0

Matthew Vines
Matthew Vines

Reputation: 27561

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

Upvotes: 4

Related Questions