2016-11-23 4 views
5

üzerinde 'UserSecretsIdAttribute' bulunamadı: Eklediğim nerede yerine JSON csproj dosyasını kullanıyorumBen ASP.NET Çekirdek 1.1 kullanıyorum ve başlangıçta var aşağıdaki montaj 'ef'

ConfigurationBuilder builder = new ConfigurationBuilder(); 
builder.AddUserSecrets(); 

:

Ben komutu çalıştırdığınızda
<PropertyGroup> 
    <UserSecretsId>8844d677-223b-4527-a648-387a65933d55</UserSecretsId> 
</PropertyGroup> 

Ama:

dotnet ef migrations add "InitialCommit" 

hatayı alıyorum:

An error occurred while calling method 'ConfigureServices' on startup class 'Startup'. Consider using IDbContextFactory to override the initialization of the DbContext at design-time. Could not find 'UserSecretsIdAttribute' on assembly 'ef, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" 

Neden olursa olsun?

cevap

0

Nihayet paketin bir sürümünü değiştirdiğimde benim için çalışmıştı: .csproj:

<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="1.1.2" /> 

için:

<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="1.1.1" />