title: IRazorViewEngine.FindView with GetView can't find view
body: <p>In my asp.net core project I'm trying to find Razor view using this method:</p>
  <pre class="lang-cs prettyprint-override"><code>private IView FindView(ActionContext actionContext, string viewName)
  {
      var getViewResult = _viewEngine.GetView(executingFilePath: null, viewPath: viewName, isMainPage: true);
      if (getViewResult.Success)
      {
          return getViewResult.View;
      }
  
      var findViewResult = _viewEngine.FindView(actionContext, viewName, isMainPage: true);
      if (findViewResult.Success)
      {
          return findViewResult.View;
      }
  
      var searchedLocations = getViewResult.SearchedLocations.Concat(findViewResult.SearchedLocations);
      var errorMessage = string.Join(
          Environment.NewLine,
          new[] { $&quot;Unable to find view '{viewName}'. The following locations were searched:&quot; }.Concat(searchedLocations));
  
      throw new InvalidOperationException(errorMessage);
  }
  </code></pre>
  <p>where</p>
  <pre><code>viewName = &quot;Views/Email/ResetPassword.cshtml&quot;
  </code></pre>
  <p>and <code>_viewEngine</code> is <code>IRazorViewEngine</code>, but it doesn't find any.</p>
  <p>My project structure:</p>
  <p><a href="https://i.stack.imgur.com/KSGKS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KSGKS.png" alt="Project structure" /></a></p>
  <p><code>IView.FindView</code> method is called from Business.</p>
  <p>I also have another project, that have the project structure and uses the same method for retrieving views and, more importantly, it finds this view, but it uses netcoreapp2.2, and my current project uses netcoreapp3.1 (Microsoft.AspNetCore.Mvc.Razor versions are the same - 2.2.0).</p>
  <p>Why can't this method find views on .net core 3.1?</p>
  <hr />
  <p><strong>UPDATE</strong></p>
  <p>Both projects copy this Views folder to <code>Api\bin\Debug\netcoreapp{version}</code> folder on build.</p>