我试着在单声道下运行一个asp.Net 5 mvc。对于第一步,我尝试从哟运行应用程序模板
我的步骤是:yo aspnet
cd MyWeb
kpm restore --source https://www.myget.org/F/aspnetvnext/api/v2/
kpm build
该命令后,我得到以下错误:
这是我的project.json:
{
/* Click to learn more about project.json http://go.microsoft.com/fwlink/?LinkID=517074 */
"webroot": "wwwroot",
"version": "1.0.0-*",
"dependencies": {
"EntityFramework.SqlServer": "7.0.0-beta3",
"EntityFramework.Commands": "7.0.0-beta3",
"Microsoft.AspNet.Mvc": "6.0.0-beta3",
/* "Microsoft.AspNet.Mvc.WebApiCompatShim": "6.0.0-beta3", */
"Microsoft.AspNet.Diagnostics": "1.0.0-beta3",
"Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta3",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta3",
"Microsoft.AspNet.Security.Cookies": "1.0.0-beta3",
"Microsoft.AspNet.Server.IIS": "1.0.0-beta3",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta3",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta3",
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta3",
"Microsoft.Framework.CodeGenerators.Mvc": "1.0.0-beta3",
"Microsoft.Framework.Logging": "1.0.0-beta3",
"Microsoft.Framework.Logging.Console": "1.0.0-beta3",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta3",
/* Modifications for Mono Support*/
"EntityFramework.InMemory": "7.0.0-beta3",
"Kestrel": "1.0.0-beta3"
},
"commands": {
/* Change the port number when you are self hosting this application */
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5001",
"kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5004",
"gen": "Microsoft.Framework.CodeGeneration",
"ef": "EntityFramework.Commands"
},
"frameworks": {
"aspnet50": {},
"aspnetcore50": {}
},
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
],
"bundleExclude": [
"node_modules",
"bower_components",
"**.kproj",
"**.user",
"**.vspscc"
],
"scripts": {
"postrestore": ["npm install"],
"prepare": ["grunt bower:install"]
}
}
使用的版本是:
Mono JIT编译器版本3.12.0(2015年2月7日星期六UTC tarball)
KRE:1.0.0-beta4-11166
似乎Microsoft.Framework.ConfigurationModel出了点问题,但是没有解决办法。我希望有人能给我一个提示,指出正确的方向!
非常感谢您的阅读!
问候亚历克斯
最佳答案
不确定,但是在我的VisualStudio中,MyGet地址是“https://www.myget.org/F/aspnetvnext/”。尝试将其与kpm restore配合使用。
另外,VS CTP5-> CTP6更新后出现了相同的错误,从beta2-> beta3还原软件包提供了帮助,因此这似乎是错误的软件包版本错误。
添加:
如果出现迁移错误,请替换以下用法:
/*
using Microsoft.Data.Entity.Migrations;
using Microsoft.Data.Entity.Migrations.Builders;
using Microsoft.Data.Entity.Migrations.Infrastructure;
*/
using Microsoft.Data.Entity.Relational.Migrations;
using Microsoft.Data.Entity.Relational.Migrations.Builders;
using Microsoft.Data.Entity.Relational.Migrations.Infrastructure;