Expand Minimize

How to: Run SPCAF in Visual Studio

By default SPCAF installs a Visual Studio add-in available for Visual Studio 2010, 2012 and 2013. This add-in adds a menu entry to the Tools menu and to the context menu of Solution and Project. From this menu you can start the SharePoint code analysis.

Open SharePoint Project

Open a SharePoint project and right click on a project or the solution. The following popup opens and allows you to start the SharePoint code analysis.

Running Code Analysis

Select "Run SharePoint Code Analysis" to analyze the whole solution or a single project, depending on your current selection. SPCAF will compile the project to create the WSP package. After successful compilation the analysis will start. During the analysis the output of the analysis process can be found in Output Window under "SharePoint Code Analysis Tools".

If analysis succeeds the errors and warnings are added to the Error List. Here you can filter the errors and warnings. Double click on a message will open the file with the error or warning and you can fixed it immediately.

If you need more information for an error you can right click the error message and select "Show Error Help".

The SPCAF documentation opens and describes the error in detail or you can find additional links how to solve the problem.

Cancelling Analysis

During analysis you can cancel the process. Right click on a project and select "Cancel SharePoint Code Analysis".

Configure SPCAF

SPCAF comes with several rulesets. You can select the ruleset for the analysis in Visual Studio in the menu.

Select the ruleset and click OK.

Create Reports

Additional entries in the SPCAF menu allow you to create rule reports, metrik reports or an inventory report.

The reports are HTML reports and will be opened directly in Visual Studio. Internally the reports are saved to the solution directory in folder _SPCAF.Reports

Create Dependency Diagram

You can also create dependency diagrams in format DGML.

The diagram visualizes the dependencies between the WSP packages (like references between Featues, inheritance of ContentTypes etc.).

Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of RENCORE AB. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.