title: asp.net mvc core The call is ambiguous between the following methods or properties:
body: <p>I am working on an application, and I got an error in Startup.cs partial classes, and I cant find why this error shows up:</p>
  
  <p>The call is ambiguous between the following methods or properties: 
  Microsoft.Extensions.DependencyInjection.OptionsServiceCollectionExtensions.Configure(Microsoft.Extensions.DependencyInjection.IServiceCollection, System.Action)
  Microsoft.Extensions.DependencyInjection.OptionsServiceCollectionExtensions.Configure(Microsoft.Extensions.DependencyInjection.IServiceCollection, System.Action)</p>
  
  <p>My two partial Startup.cs classes are</p>
  
  <pre><code>using Microsoft.Extensions.DependencyInjection;
  using System.Security.Claims;
  using Microsoft.AspNetCore.Http;
  using Microsoft.Extensions.Configuration;
  
  
  namespace GiftUWish.WebAPI
  {
      public partial class Startup
      {
          private void SetServices(IServiceCollection services)
          {
              //PROFILE service and repository
              services.AddScoped&lt;IProfileService, ProfileService&gt;();
              services.AddScoped&lt;IProfileRepository, ProfileRepository&gt;();
  
              ////GIFT service and repository
              services.AddScoped&lt;IBankAccountService, BankAccountService&gt;();
              services.AddScoped&lt;IBankAccountRepository, BankAccountRepository&gt;();
  
              //EVENT service and repository
              services.AddScoped&lt;ICreditCardService, CreditCardService&gt;();
              services.AddScoped&lt;ICreditCardRepository, CreditCardRepository&gt;();
  
  
              //CREDIT CARD INFORMATION serice and repository
              services.AddScoped&lt;IPayPalService, PayPalService&gt;();
              services.AddScoped&lt;IPayPalRepository, PayPalRepository&gt;();
  
              //CHIPPED IN serive and repository
              services.AddScoped&lt;IShippingAdressService, ShippingAdressService&gt;();
              services.AddScoped&lt;IShippingAdressRepository, ShippingAdressRepository&gt;();
  
              //UNIT OF WORK
              services.AddScoped&lt;IUnitOfWork, UnitOfWork&gt;();
  
              //Authentication-Token , Header which contains information about user from Identity Server
              services.AddTransient&lt;ClaimsPrincipal&gt;(s =&gt; s.GetService&lt;IHttpContextAccessor&gt;().HttpContext.User);
  
              //Facebook Graph API
              services.AddScoped&lt;IApi, Service.FacebbokGraph.API&gt;();
  
              //Setup configuration settings form appsettings.json
  
              services.Configure&lt;FacebookApiSettings&gt;(Configuration.GetSection("Facebook"));
              services.Configure&lt;BrainTreeSettings&gt;(Configuration.GetSection("Paiment:BrainTree"));
              services.Configure&lt;PayPalAdaptivePaymentsAPI&gt;(Configuration.GetSection("Paiment:PayPal:PayPalAdaptivePaymentsAPI"));
              services.Configure&lt;PayPalNonAdaptivePaymentsAPI&gt;(Configuration.GetSection("Paiment:PayPal:PayPalNonAdaptivePaymentsAPI"));
              services.Configure&lt;PayPalPayFlow&gt;(Configuration.GetSection("Paiment:PayPal:PayPalPayFlow"));
  
              services.AddSingleton&lt;IConfiguration&gt;(Configuration);
          }
      }
  }
  
  
  using Microsoft.AspNetCore.Authentication.Cookies;
  using Microsoft.AspNetCore.Builder;
  using Microsoft.AspNetCore.Hosting;
  using Microsoft.AspNetCore.Http;
  using Microsoft.AspNetCore.Mvc;
  using Microsoft.Extensions.Configuration;
  using Microsoft.Extensions.DependencyInjection;
  using Microsoft.Extensions.Logging;
  using Newtonsoft.Json.Serialization;
  using System.Threading.Tasks;
  
  namespace GiftUWish.WebAPI
  {
      public partial class Startup
      {
          public static IConfiguration Configuration { get; set; }
  
          private readonly string Audience = "https://localhost:44362/";
  
          public Startup(IHostingEnvironment env)
          {
              var builder = new ConfigurationBuilder()
                  .SetBasePath(env.ContentRootPath)
                  .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                  .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
                  .AddEnvironmentVariables();
              Configuration = builder.Build();
          }
  
          // This method gets called by the runtime. Use this method to add services to the container.
          public void ConfigureServices(IServiceCollection services)
          {
              // Add framework services.
              services
                  .AddMvc(options =&gt;
                  {
                      options.Filters.Add(new RequireHttpsAttribute());
                  })
                  .AddJsonOptions(options =&gt;
                  {
                      options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
                  });
  
              services.Configure&lt;CookieAuthenticationOptions&gt;(options =&gt;
              {
                  options.Events = new CookieAuthenticationEvents()
                  {
                      OnRedirectToLogin = ctx =&gt;
                      {
                          if (ctx.Request.Path.StartsWithSegments("/api") &amp;&amp; ctx.Response.StatusCode == 200)
                          {
                              ctx.Response.StatusCode = (int)System.Net.HttpStatusCode.Unauthorized;
                              return Task.FromResult&lt;object&gt;(null);
                          }
                          else
                          {
                              ctx.Response.Redirect(ctx.RedirectUri);
                              return Task.FromResult&lt;object&gt;(null);
                          }
                      }
                  };
              });
  
  
              //Add DI and other services
              SetServices(services);
          }
  
          // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
          public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
          {
              loggerFactory.AddConsole(Configuration.GetSection("Logging"));
              loggerFactory.AddDebug();
  
              app.UseDeveloperExceptionPage();
  
              CookieAuthenticationOptions options = new CookieAuthenticationOptions();
              options.AuthenticationScheme = "Cookies";
              options.CookieName = "GUW Cookie";
              options.AutomaticAuthenticate = true;
              options.AutomaticChallenge = true;
              options.LoginPath = new PathString("/Account/Login");
              options.Events = new CustomCookieAuthenticationEvents();
  
              app.UseCookieAuthentication(options);
  
              app.UseMvc();
          }
      }
  }
  </code></pre>
  
  <p>Project.json dependencies</p>
  
  <p>"dependencies": {
      "Braintree": "2.61.0",
      "Microsoft.AspNet.Mvc.Core": "6.0.0-rc1-final",
      "Microsoft.AspNetCore.Diagnostics": "1.0.0",
      "Microsoft.AspNetCore.Identity": "1.0.0",
      "Microsoft.AspNetCore.Mvc": "1.0.0",
      "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
      "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
      "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
      "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
      "Microsoft.Extensions.Configuration.Json": "1.0.0",
      "Microsoft.Extensions.Logging": "1.0.0",
      "Microsoft.Extensions.Logging.Console": "1.0.0",
      "Microsoft.Extensions.Logging.Debug": "1.0.0",
      "Microsoft.Extensions.Options": "1.0.0",
      "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
      "Microsoft.IdentityModel.Tokens": "5.0.0",
      "Microsoft.Owin.Security.Cookies": "3.0.1",
      "Microsoft.Owin.Security.OAuth": "3.0.1",
      "Newtonsoft.Json": "9.0.1",
      "PayPal": "1.7.3",
      "PayPalAdaptiveAccountsSDK": "2.9.110",
      "PayPalAdaptivePaymentsSDK": "2.15.117",
      "PayPalCoreSDK": "1.7.1",
      "PayPalMerchantSDK": "2.16.117",
      "System.IdentityModel.Tokens.Jwt": "5.0.0"
    },</p>
  
  <p>The error is here:</p>
  
  <pre><code>services.Configure&lt;FacebookApiSettings&gt;(Configuration.GetSection("Facebook"));
              services.Configure&lt;BrainTreeSettings&gt;(Configuration.GetSection("Paiment:BrainTree"));
              services.Configure&lt;PayPalAdaptivePaymentsAPI&gt;(Configuration.GetSection("Paiment:PayPal:PayPalAdaptivePaymentsAPI"));
              services.Configure&lt;PayPalNonAdaptivePaymentsAPI&gt;(Configuration.GetSection("Paiment:PayPal:PayPalNonAdaptivePaymentsAPI"));
              services.Configure&lt;PayPalPayFlow&gt;(Configuration.GetSection("Paiment:PayPal:PayPalPayFlow"));
  </code></pre>
  
  <p>thnx</p>