6

When I run unit test from ReSharper my AppDomain.CurrentDomain.SetupInformation have path: C:\Users\%USERNAME%\AppData\Local\Temp\hwa3yebt.mas\<project>.config (IIS temp dictionary) and it doesn't work and throws System.IO.FileNotFoundException becouse can not find configuration file.

Configuration file has Copy to output directory : Copy always (I'm not sure if this is required)

but when I run unit test from Visual Studio test explorer AppDomain.CurrentDomain.SetupInformation have path : C:/Repository/<project>/bin/debug and it works.

What I should do to run ReSharper unit tests?

2 Answers2

1

Check Resharper runs UnitTest from different location

WeSam Abdallah
  • 1,050
  • 1
  • 10
  • 16
0

This could be because Reshaper has shadow copy turned on by default. This means that the test will run from a different location then projects default output path. You can turn this off by removing this default.

ReSharper > Options... > Tools > Unit Testing > Shadow-copy assemblies being tested

Saeed Gatson
  • 517
  • 5
  • 18
  • 1
    Having the same problem, that option didn't really fix it. AppDomain.CurrentDomain.SetupInformation.ConfigurationFile points to C:\Users\[user]\AppData\Local\Temp\n0mthe3j.lik\[guid].config – WeSam Abdallah Oct 25 '17 at 17:41