When setting an OOB default Visual Studio 2013 Update 5 Project, with no tests setup, using the Target Framework of 4.6.1, adding a Fakes assembly to System and setting the following ShimGenerations:
mscorlib.fakes:
<ShimGeneration>
<Clear/>
<Add FullName="System.Collections.ReadOnlyCollectionBase"/>
<Add FullName="System.ApplicationException"/>
<Add FullName="System.IO.Path"/>
<Add FullName="System.Security.SecureString"/>
<Add FullName="Microsoft.Win32.Registry"/>
<Add FullName="Microsoft.Win32.RegistryKey"/>
<Add FullName="System.Activator"/>
<Add FullName="System.Convert"/>
<Add FullName="System.Version"/>
<Add FullName="System.StringComparer"/>
<Add FullName="System.Threading.Thread"/>
</ShimGeneration>
System.fakes:
<ShimGeneration>
<Clear/>
<Add FullName="System.Text.RegularExpressions.Regex"/>
<Add FullName="System.Diagnostics.FileVersionInfo"/>
<Add FullName="System.Diagnostics.Process"/>
<Add FullName="System.Net.CookieContainer"/>
<Add FullName="System.Net.FtpWebRequest"/>
<Add FullName="System.Net.FtpWebResponse"/>
<Add FullName="System.Net.IPAddress"/>
<Add FullName="System.Net.Dns"/>
<Add FullName="System.Net.Mail.SmtpClient"/>
<Add FullName="System.Net.Mail.MailMessage"/>
<Add FullName="System.Net.NetworkInformation.Ping"/>
<Add FullName="System.Net.NetworkInformation.PingReply"/>
<Add FullName="System.Net.NetworkInformation.PingException"/>
<Add FullName="System.Net.HttpWebRequest"/>
<Add FullName="System.Net.HttpWebResponse"/>
<Add FullName="System.Net.WebHeaderCollection"/>
<Add FullName="System.Net.ServicePoint"/>
<Add FullName="System.Net.NetworkInformation.NetworkInterface"/>
<Add FullName="System.Net.Sockets.TcpClient"/>
<Add FullName="System.Net.Sockets.UdpClient"/>
<Add FullName="System.Net.Sockets.Socket"/>
<Add FullName="System.Net.WebRequestMethods"/>
<Add FullName="System.Net.WebRequest"/>
<Add FullName="System.Uri"/>
</ShimGeneration>
The following error occurs:
'System.Net.Sockets.SocketClientAccessPolicyProtocol' is obsolete: 'This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.'
[some path\TestFakes\UnitTestProject1\obj\Debug\Fakes\s\f.csproj] some path\TestFakes\UnitTestProject1\f.csGENERATEFAKES : error : project compilation failed with exit code 1
This appears to only to occur with this configuration.
I am not sure how to work around this since I need to intercept most of the .NET framework calls.