diff --git a/src/Microsoft.AspNet.Cors.Core/CorsServiceCollectionExtensions.cs b/src/Microsoft.AspNet.Cors.Core/CorsServiceCollectionExtensions.cs index 544b426837..11c1b5261a 100644 --- a/src/Microsoft.AspNet.Cors.Core/CorsServiceCollectionExtensions.cs +++ b/src/Microsoft.AspNet.Cors.Core/CorsServiceCollectionExtensions.cs @@ -35,8 +35,8 @@ namespace Microsoft.Framework.DependencyInjection public static IServiceCollection AddCors(this IServiceCollection serviceCollection) { serviceCollection.AddOptions(); - serviceCollection.AddTransient(); - serviceCollection.AddTransient(); + serviceCollection.TryAdd(ServiceDescriptor.Transient()); + serviceCollection.TryAdd(ServiceDescriptor.Transient()); return serviceCollection; } }