ReSharper unit test runner and AppDomain name issues

Since I cannot create an issue in the issue tracker, here it is:

 

I'm running into an issue while running tests with the ReSharper test runner in combination with the Microsoft.AspNetCore.Mvc.Testing package:

```
System.ArgumentException
The content root 'C:\Projects\Lampe.WebServices\Lampe.WebServices' does not exist.
Parameter name: contentRootPath
```

Tests dó run correctly when using the Visual Studio built-in test runner.


I tracked it down all the way to the following code in MS.AspNetCore.Mvc.Testing:

```csharp
// The default dependency context will be populated in .net core applications.
var context = DependencyContext.Default;
if (context == null || context.CompileLibraries.Count == 0)
{
// The app domain friendly name will be populated in full framework.
return new[] { Assembly.Load(AppDomain.CurrentDomain.FriendlyName) };
}
```

When using VS test runner, "AppDomain.CurrentDomain.FriendlyName" has the name of the test project (Lampe.WebServices.Test).
But when using ReSharper test runner, "AppDomain.CurrentDomain.FriendlyName" has the name "Entryway".

Entryway is not a valid assembly, so it fails to load that assembly, and eventually, fails to detect the web project location.

In my opinion, the appdomain name created by the ReSharper runner should be called the same as the test assembly (like how VS test runner does this).

 

1
2 comments
Avatar
Permanently deleted user

I have similar issue because of ReSharper test runner, "AppDomain.CurrentDomain.FriendlyName" has the name "Entryway".

 

Call IsolatedStorageFile.GetUserStoreForDomain() fails with "System.IO.IsolatedStorage.IsolatedStorageException: Unable to determine the identity of domain." exception

Latest version which works is 2018.2.3

ReSharper2018.3 has the issue.

 

0

Hi Dmitriy,

The discussion about AppDomain name can be found in this report: https://youtrack.jetbrains.com/issue/RSRP-472316, please try checking the 'Run tests in AppDomain' ReSharper option in Tools | Unit Testing | Test Runner.

The fix for System.IO.IsolatedStorage.IsolatedStorageException https://youtrack.jetbrains.com/issue/RSRP-472980 will be included in ReSharper 2018.3.2 bugfix update. 

0

Please sign in to leave a comment.