title: .net core 2.1 test API controller missing AspNetCore.Mvc reference
body: <p>I'm trying to tests an API controller with .net core 2.1 as from <a href="https://docs.microsoft.com/en-us/aspnet/core/mvc/controllers/testing?view=aspnetcore-2.1" rel="nofollow noreferrer">this MS doc</a>.</p>
  
  <p>My code looks like</p>
  
  <pre><code>    [Fact]
      public async Task ShouldReturnOkWithHealthBackend()
      {
          var apiConsumerService = new Mock&lt;IApiConsumerService&gt;();
          apiConsumerService.Setup(m =&gt; m.Consume()).Returns(Task.FromResult(true));
  
          var controller = new HealthController(apiConsumerService.Object);
  
          await controller.GetHealth();
      }
  </code></pre>
  
  <p>When doing the await controller method invocation I get stucked with an "Assembly not referenced error"</p>
  
  <p>I can add the</p>
  
  <pre><code>using Microsoft.AspNetCore.Mvc;
  </code></pre>
  
  <p>But VS says that AspNetCore does not exists in the Microsoft namespace.</p>
  
  <p>Intellisense suggests me to add some references but this doesn't work too.</p>
  
  <p><a href="https://i.stack.imgur.com/dVFXW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dVFXW.png" alt="Intellisense suggestions to add AspNetMVC.Core"></a></p>
  
  <p>But clicking it does nothing. I have also tried to play with the csproj file to see if I can force those assemblies to be loaded but still no success.</p>
  
  <p>I've tested with the XUnit template as well as a custom NUnit project with same results.</p>
  
  <p>My csproj from API and test project are</p>
  
  <p><a href="https://i.stack.imgur.com/5VvJj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5VvJj.png" alt="diff csproj"></a></p>
  
  <p>What kind of project do I need to create to test a Controller like in the MS doc?</p>