1

When I try to run my test suite, which works fine under Visual Studio 2008, I get the following error in the Output window:

Error loading J:\VBProjects2010\Libraries\PFTest\PFTest\bin\Debug\PFTest.dll: Could not load file or assembly 'file:///J:\VBProjects2010\Libraries\PFTest\PFTest\bin\Debug\PFTest.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

Note that these same tests can be viewed in the Test View windows, and run well under Visual Studio 2008, but fail only under VS2010.

Note that PFTest.dll is the test project's name, and the dll is the file created when I compile (which compiles ok).

James McNellis
  • 348,265
  • 75
  • 913
  • 977
gouderadrian
  • 361
  • 4
  • 11

3 Answers3

10

strong textIn addition to the above, I realised I could not step through code either since the compiled dlls and exe could not be loaded from the shared drive.

This solved the problem. Edit C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config

Add <loadFromRemoteSources enabled="true"/> under <runtime> so that it looks like this:

<runtime>
    <loadFromRemoteSources enabled="true" />
    <UseSmallInternalThreadStacks enabled="true" />
    ...
Mark Hildreth
  • 42,023
  • 11
  • 120
  • 109
gouderadrian
  • 361
  • 4
  • 11
  • 7
    The config file is under c:\Program Files(x86)\Microsoft Visual Studio 10.0\Common7\IDE for those with a 64 bit virtual machine. – Rap Sep 30 '10 at 14:45
  • This did not work for me in VS 2012. I had to add the node to `C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config` instead. – Tobias Brandt May 19 '15 at 21:18
1

The gouderadrian's anwser did not worked for me. I am on a VirtualBox machine with Windows 7 64 bits and Visual Studio 2012.

I had to move the output to a local folder : open the unit tests project properties and in the Build tab, browse the Output path to a local folder. The tests are now detected and can be run.

Community
  • 1
  • 1
Dude Pascalou
  • 2,989
  • 4
  • 29
  • 34
0

For Visual Studio 2010 Express for Windows Phone the file you're looking for has the name VDPExpress.exe.config.

MS's docs here: http://msdn.microsoft.com/en-us/library/dd409252.aspx

Robin
  • 565
  • 1
  • 6
  • 9