Running unit tests in VS2012 from network shares / within VM
Running Visual Studio 2012 with Update 3 and ReSharper 7.1.3 running in a VMWare machine with Windows 7 64bit.
When working with projects on network shares or mapped drives I found that the assemblies are not being loaded due to the change in CAS policies with .NET 4.0
System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
I know I need to add the reference to loadFromRemoteSources = true to a config file somewhere but so far the following have not worked
devenv.exe.config all of the resharper testrunner ones
Used task manager to see what process was running the tests and found it was vstest.executionengine.
Found the relevant config file "vstest.executionengine.x86.config" and added the following to the <runtime>
section <loadFromRemoteSources enabled="true"/>
Visual Studio 2012
C:Program Files (x86)Microsoft Visual Studio 11.0Common7IDECommonExtensionsMicrosoftTestWindow
Visual Studio 2013
C:Program Files (x86)Microsoft Visual Studio 11.0Common7IDECommonExtensionsMicrosoftTestWindow