title: Encounters Unable to load one or more of the requested types while doing Integration Test
body: <p>I am doing Integration test for an asp.net core API with Target Famrwework 4.6 as the project requires some of my old 4.6 dll. I am getting the below error.</p>
  
  <p><strong>Message: System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.</strong></p>
  
  <p><strong>The error comes when I call await _client.GetAsync</strong></p>
  
  <p>I have attached the StackTace image.<a href="https://i.stack.imgur.com/XLYFy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XLYFy.png" alt="enter image description here"></a></p>
  
  <p>My test Project is a class library framework 4.6.</p>
  
  <p><strong>TestFixture.cs</strong></p>
  
  <pre><code> public class TestFixture :IDisposable
      {
          private const string SolutionName = "Project.API.sln";
          private readonly TestServer _server;
  
          public HttpClient Client { get; }
  
          public TestFixture()
          {
              Assembly startAssembly = typeof(Startup).GetTypeInfo().Assembly;
              var contentRoot = GetProjectPath(startAssembly);
              var builder = new WebHostBuilder()
                  .UseContentRoot(contentRoot)
                  .UseEnvironment("Development")
                  .UseStartup&lt;Startup&gt;();
  
              _server = new TestServer(builder);
              Client = _server.CreateClient();
              Client.BaseAddress = new Uri("http://localhost:62455");
          }
  
          public string GetProjectPath(Assembly startupAssembly)
          {
              var projectName = startupAssembly.GetName().Name;
              var applicationBasePath = PlatformServices.Default.Application.ApplicationBasePath;
              DirectoryInfo directoryInfo = new DirectoryInfo(applicationBasePath);
              do
              {
                  var solutionFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, SolutionName));
                  if (solutionFileInfo.Exists)
                  {
                      return Path.GetFullPath(Path.Combine(directoryInfo.FullName, projectName));
                  }
                  directoryInfo = directoryInfo.Parent;
              }
              while (directoryInfo.Parent != null);
              throw new Exception($"Solution root could be located using application root {applicationBasePath}");
          }
  
          public void Dispose()
          {
              Client.Dispose();
              _server.Dispose();
          }
      }
  </code></pre>
  
  <p><strong>Test.cs</strong></p>
  
  <pre><code> public class TransactionControllerTest :IClassFixture&lt;TestFixture&gt;
      {
          private string businessID = "1206";
          private readonly HttpClient _client;
          public TransactionControllerTest(TestFixture fixture)
          {
              _client = fixture.Client;
          }
          [Fact]
          public async void ProcessFinalTransactionProcess()
          {
              var response = await _client.GetAsync($"/v1/businesses/{businessID}/transactions/TestMe");
              Assert.NotNull(response);
          }
      }
  </code></pre>