title: VS Code ASP.NET MVC System.TypeLoadException
body: <p>I'm using VS Code 2019 on a Mac and when running my program (I've only added one model, one controller and one view as per a tutorial) I get the following error:</p>
  
  <pre><code>Exception has occurred: CLR/System.TypeLoadException
  An exception of type 'System.TypeLoadException' occurred in System.Private.CoreLib.dll but was not handled in user code: 'Could not load type 'System.Web.HttpContextBase' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.'
  </code></pre>
  
  <p>It's showing up in the Startup.cs file at the bottom under app.useEndpoints:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Threading.Tasks;
  using Microsoft.AspNetCore.Builder;
  using Microsoft.AspNetCore.Hosting;
  using Microsoft.AspNetCore.HttpsPolicy;
  using Microsoft.Extensions.Configuration;
  using Microsoft.Extensions.DependencyInjection;
  using Microsoft.Extensions.Hosting;
  
  namespace vidlytest
  {
     public class Startup
  {
      public Startup(IConfiguration configuration)
      {
          Configuration = configuration;
      }
  
      public IConfiguration Configuration { get; }
  
  
  
      public void ConfigureServices(IServiceCollection services)
      {
          services.AddRazorPages();
      }
  
      public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
      {
          if (env.IsDevelopment())
          {
              app.UseDeveloperExceptionPage();
          }
          else
          {
              app.UseExceptionHandler("/Error");
              app.UseHsts();
          }
  
          app.UseHttpsRedirection();
          app.UseStaticFiles();
  
          app.UseRouting();
  
          app.UseAuthorization();
  
          app.UseEndpoints(endpoints =&gt;
          {
              endpoints.MapRazorPages();
          });
      }
  }
  }
  </code></pre>