Hi, I have, over the past few months, encountered an issue with tests working from from CLI using `dotnet test` command, but failing from NCrunch VS22/VS26 runner window.
The setup looks something like this:
We have an `EmailGenerator.csproj` project that is of type <Project Sdk="Microsoft.NET.Sdk.Razor">
It's used as a library project that is referenced by other API/Console type projects.
Inside of it are multiple .cshtml files that we use to generate html emails.
The code inside is based on:
https://scottsauber.com/...standard-class-library/
We have an e2e xunitv3 test project that runs some tests.
The tests always work fine when run via `dotnet test`.
When running via NCrunch - once in a few days/weeks, they start failing with the error:
System.InvalidOperationException: Unable to find view '/Views/Emails/EmailConfirmation/EmailConfirmation.cshtml'. The following locations were searched:
/Views/Emails/EmailConfirmation/EmailConfirmation.cshtml
Basically, some files cannot be found.
Whenever this happens, running `dotnet test` once fixes the NCrunch issue, and after that, NCrunch is able to find the view and run the tests.
It's not a dealbreaker, as there is a workaround (dotnet test).
And I can also always substitute the actual class with some mock implementation as an alternative.
But we are trying to test as close to the real production as we can. So ideally, I would love to make it work the same way it does when run via ' dotnet test`.
I would appreciate any suggestions/pointers. I am hoping that maybe I have misconfigured something, and this is solvable by setting some flag in settings. But so far, I was unable to find anything that looked related.