How-To's

SharePoint and LightSwitch Support in ReSharper 7

The ReSharper team here at JetBrains has added support for SharePoint and LightSwitch projects to ReSharper 7. Due to how these project types handle generated partial classes, previous versions of ReSharper displayed errors even though the project compiled successfully. By implementing support for these project types in ReSharper 7, ReSharper no longer displays spurious errors allowing developers to be more productive when using these project types. To see the improvements in action, let’s look at a SharePoint project and a LightSwitch project using ReSharper 6.1 and ReSharper 7.

Creating a SharePoint Site Definition project, ReSharper 6.1 displayed 3 errors in one file:

SharePoint Site Definition project with ReSharper 6.1

With ReSharper 7, that same project shows no errors:

SharePoint Site Definition project with ReSharper 7.0

ReSharper 7 now understands SharePoint-specific master pages, resources, style sheets, and JavaScript files, which dramatically reduces the number of false errors reported by ReSharper’s analysis engine.

Screen Shot 2012-08-02 at 3.48.55 PM.png

Screen Shot 2012-08-02 at 3.51.06 PM.png

If you open the LightSwitch Course Manager in Visual Studio, ReSharper 6.1 displayed 170 spurious errors across 16 files:

LightSwitch Course Manager with ReSharper 6.1

With ReSharper 7, no errors are displayed:

LightSwitch Course Manager with ReSharper 7.0

ReSharper 6.1 couldn’t locate partial methods or certain global LightSwitch-related classes such as User or Permissions:

Error in User class with ReSharper 6.1

ReSharper 7 can:

No errors in User class with ReSharper 7.0

ReSharper 6.1 couldn’t locate model partial classes or base classes:

SharePoint partial classes can't be resolved with ReSharper 6.1

ReSharper 7 can:

ReSharper 7.0 resolves SharePoint partial classes

Notice that ReSharper 7 provides quick-fixes for unused parameters, superfluous “this” usage, and all the other great features you expect from ReSharper. The SharePoint and LightSwitch enhancements in ReSharper 7 work for both C# and VB.NET projects. SharePoint and LightSwitch developers can now develop with pleasure too!

image description