title: How to fix 'IMvcBuilder' doesn't contain a definition for 'AddXmlDataContractSerializerFormatters'
body: <p>I have the latest .Net Core v2.1.4. </p>
  
  <p>I tried to add <code>AddXmlDataContractSerializerFormatters();</code> in the <code>Startup.cs</code> file but it reports that <code>IMvcBuilder</code> doesn't contain a definition for it.</p>
  
  <p>My <code>startup.cs</code>:</p>
  
  <pre><code>{
      services.AddMvc().AddXmlDataContractSerializerFormatters();
  }
  
  public void Configure(IApplicationBuilder app, IHostingEnvironment env)
  {
      if (env.IsDevelopment())
      {
          app.UseDeveloperExceptionPage();
      }
  
      app.UseMvc();
  
      app.Run(async(context) =&gt;
      {
          await context.Response.WriteAsync("MVC didn't find anything!");
      });
  }
  </code></pre>