2016-05-23 14 views
5

ConfigureServices(IServiceCollection services) yılında services.AddOptions() ekledikten sonra aşağıdaki hata oluşuyor:Muğlak çağrı services.AddOptions() (IServiceCollection hizmetleri)

CS0121 
The call is ambiguous between the following methods or properties: Microsoft.Extensions.DependencyInjection.OptionsServiceCollectionExtensions.AddOptions(Microsoft.Extensions.DependencyInjection.IServiceCollection) and Microsoft.Extensions.DependencyInjection.OptionsServiceCollectionExtensions.AddOptions(Microsoft.Extensions.DependencyInjection.IServiceCollection)' 

Kodu:

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Threading.Tasks; 
using Microsoft.AspNetCore.Builder; 
using Microsoft.AspNetCore.Hosting; 
using Microsoft.EntityFrameworkCore; 
using Microsoft.Extensions.Configuration; 
using Microsoft.Extensions.DependencyInjection; 
using Microsoft.Extensions.Logging; 

... 

public void ConfigureServices(IServiceCollection services) 
{ 
    ... 
    services.AddOptions(); 
    ... 
} 

Bu belirsizlik olduğu gibi özellikle garip Aynı 'yöntemler veya doğrular' arasındaki

+1

Aynı türde olması, yalnızca bu türün her ikisinde de başvuruda bulunduğunuz iki derlemede tanımlandığı anlamına gelebilir. [Bu] kopyası (http://stackoverflow.com/q/36769984/21567)? –

+0

Evet, teşekkürler @ Christian.K. Bir öncekini takip edecek. Teşekkürler! – Ovi

cevap

11

this question'dan alınan geri bildirime göre Ben kendi başına bütün mesele "Microsoft.Extensions.Options": "1.0.0-rc2-final" sadece referanslar bulunmaz OptionsModel tüm olanları kaldırmaktır "Microsoft.Extensions.OptionsModel": "1.0.0-rc1-final"

bir referansı vardır "EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final" için project.lock.json bir başvuru vardı.