65.9K
CodeProject is changing. Read more.
Home

ShimNotSupportedException when trying Visual Studio 2012 SharePoint Emulators

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.33/5 (2 votes)

Jan 2, 2013

CPOL
viewsIcon

14760

Creating Unit Tests using the SharePoint Emulators

Introduction

Last week, I downloaded Brian Keller’s Updated Virtual Machine for Visual Studio 2012 Update 1 to start playing with the new features for SharePoint Development, Testing & Production debugging. The new stuff is really cool; now Microsoft Visual Studio Team can claim that they have a complete ALM story for building SharePoint Solutions.

One of the new features is “SharePoint Emulators” which is intended to solve the nightmares of SharePoint Unit Testing by providing a system of Fakes based shims implementing the basic behaviors of the SharePoint 2010 Server Object Model.

Problem

I fired up Visual Studio 2012 and created a couple of Unit Tests that use the SharePoint Emulators but I kept on receiving the “ShimNotSupportedException” Exception when trying to run it from Visual Studio Test Explorer.

Solution

Well, the solution is simple, just run Visual Studio 2012 “As an Administrator” Smile and this by the way applies to any Unit Tests using Microsoft Fakes Framework and not only SharePoint.

Learn More

To learn more about SharePoint Emulators, you can watch this video.