简体   繁体   中英

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.0\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow

Visual Studio 2013

C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM