A ShimsContext must be in scope in order to register shims. Use the snippet below to fix your code. - C#: using Microsoft.QualityTools.Testing.Fakes; ...

A ShimsContext must be in scope in order to register shims. Use the snippet below to fix your code.
-- C#:
using Microsoft.QualityTools.Testing.Fakes;

using(ShimsContext.Create())
{
    // your test code using Shims here
}
-- VisualBasic.NET
Imports Microsoft.QualityTools.Testing.Fakes

Using ShimsContext.Create
    ' your test code using Shims here
End Using