2017-04-23 27 views
1

試圖在Package Manager控制檯DOTNET:未處理的異常:system.missingMethodException而:入口點組件找不到「Microsoft.EntityFrameworkCore.Design

此執行dotnet ef migrations add "initial"當我有這個錯誤時的輸出誤差Image Error

我嘗試修復使用此post的問題,但沒有工作

這是我project.json文件

{ 
 
    "userSecretsId": "Jobs", 
 
    "dependencies": { 
 
    "AutoMapper.Data": "1.0.0-beta1", 
 
    "FastJobsProject.BLL": "1.0.0-*", 
 
    "FastJobsProject.Entity": "1.0.0-*", 
 
    "FluentValidation": "6.2.1-beta1", 
 
    "Microsoft.AspNetCore.Diagnostics": "1.0.0", 
 
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0", 
 
    "Microsoft.AspNetCore.Mvc": "1.0.0", 
 
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", 
 
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", 
 
    "Microsoft.AspNetCore.StaticFiles": "1.0.0", 
 
    "Microsoft.EntityFrameworkCore": "1.1.1", 
 
    "Microsoft.EntityFrameworkCore.Design": "1.1.1", 
 
    "Microsoft.EntityFrameworkCore.SqlServer": "1.1.1", 
 
    "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.1", 
 
    "Microsoft.EntityFrameworkCore.Tools": { 
 
     "version": "1.1.0" 
 
    }, 
 
    "Microsoft.Extensions.Configuration": "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.Configuration.UserSecrets": "1.0.0", 
 
    "Microsoft.Extensions.FileProviders.Physical": "1.0.0", 
 
    "Microsoft.NETCore.App": { 
 
     "version": "1.0.0", 
 
     "type": "platform" 
 
    }, 
 
    "Newtonsoft.Json": "9.0.1" 
 
    }, 
 
    "tools": { 
 
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": { 
 
     "version": "1.0.0-preview2-final", 
 
     "imports": "portable-net45+win8+dnxcore50" 
 
    }, 
 
    "Microsoft.EntityFrameworkCore.Tools": { 
 
     "imports": [ 
 
     "portable-net45+win8+dnxcore50", 
 
     "portable-net45+win8" 
 
     ], 
 
     "version": "1.0.0-preview2-final" 
 
    } 
 
    }, 
 
    "frameworks": { 
 
    "netcoreapp1.0": { 
 
     "imports": [ 
 
     "dotnet5.6", 
 
     "dnxcore50", 
 
     "portable-net45+win8" 
 
     ] 
 
    } 
 
    }, 
 
    "buildOptions": { 
 
    "emitEntryPoint": true, 
 
    "preserveCompilationContext": true 
 
    }, 
 
    "runtimeOptions": { 
 
    "gcConcurrent": true, 
 
    "gcServer": true 
 
    }, 
 
    "publishOptions": { 
 
    "include": [ 
 
     "wwwroot", 
 
     "web.config" 
 
    ] 
 
    }, 
 
    "scripts": { 
 
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] 
 
    } 
 
}

任何人都可以解釋我上面的錯誤和解決方案的意義吧。

感謝

回答

0

尋找解決方案,並在我的情況下,他們嘗試後,我來到了一個結論,即依賴版本之間的不兼容的問題。

這是我的新project.json是正確correctly工作:

{ 
 
    "userSecretsId": "Jobs", 
 

 
    "dependencies": { 
 
    "AutoMapper.Data": "1.0.0-beta1", 
 
    "FastJobsProject.BLL": "1.0.0-*", 
 
    "FastJobsProject.DAL": "1.0.0-*", 
 
    "FastJobsProject.Entity": "1.0.0-*", 
 
    "FluentValidation": "6.2.1-beta1", 
 
    "Microsoft.AspNetCore.Diagnostics": "1.0.0", 
 
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0", 
 
    "Microsoft.AspNetCore.Mvc": "1.0.0", 
 
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", 
 
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", 
 
    "Microsoft.AspNetCore.StaticFiles": "1.0.0", 
 
    "Microsoft.EntityFrameworkCore": "1.1.1", 
 
    "Microsoft.EntityFrameworkCore.SqlServer": "1.1.1", 
 
    "Microsoft.EntityFrameworkCore.Tools": { 
 
     "type": "build", 
 
     "version": "1.1.0-preview4-final" 
 
    }, 
 
    "Microsoft.Extensions.Configuration": "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.Configuration.UserSecrets": "1.0.0", 
 
    "Microsoft.Extensions.FileProviders.Physical": "1.0.0", 
 
    "Microsoft.NETCore.App": { 
 
     "version": "1.0.0", 
 
     "type": "platform" 
 
    }, 
 
    "Newtonsoft.Json": "9.0.1" 
 
    }, 
 

 
    "tools": { 
 
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": { 
 
     "version": "1.0.0-preview2-final", 
 
     "imports": "portable-net45+win8+dnxcore50" 
 
    }, 
 
    "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4" 
 
    }, 
 

 
    "frameworks": { 
 
    "netcoreapp1.0": { 
 
     "imports": [ 
 
     "dotnet5.6", 
 
     "dnxcore50", 
 
     "portable-net45+win8" 
 
     ] 
 
    } 
 
    }, 
 

 
    "buildOptions": { 
 
    "emitEntryPoint": true, 
 
    "preserveCompilationContext": true 
 
    }, 
 

 
    "runtimeOptions": { 
 
    "gcServer": true, 
 
    "gcConcurrent": true 
 
    }, 
 

 
    "publishOptions": { 
 
    "include": [ 
 
     "wwwroot", 
 
     "web.config" 
 
    ] 
 
    }, 
 

 
    "scripts": { 
 
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] 
 
    } 
 
}

我希望它可以幫助,如果有人得到了同樣的問題。