【发布时间】:2016-01-26 10:09:42
【问题描述】:
对此有什么想法吗?
我的项目.json
{
"userSecretsId": "aspnet5-WebApplication1-c5682a65-7af3-447d-a812-9b4838ea33be",
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"EntityFramework.Commands": "7.0.0-rc1-final",
"EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-rc1-final",
"Microsoft.AspNet.Diagnostics.Entity": "7.0.0-rc1-final",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final",
"Microsoft.Extensions.CodeGenerators.Mvc": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions" : "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-final",
"Microsoft.Extensions.DependencyInjection": "1.0.0-rc1-final"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel",
"ef": "EntityFramework.Commands"
},
"frameworks": {
"dnx451": {},
"dnxcore50": { }
},
"exclude": [
"wwwroot",
"node_modules"
],
"publishExclude": [
"**.user",
"**.vspscc"
],
"scripts": {
"prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ]
}
}
当我尝试运行迁移步骤时出现错误
PM> dnx ef migrations add Initial
dnx : System.ArgumentNullException: Value cannot be null.
At line:1 char:1
+ dnx ef migrations add Initial
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (System.Argument...cannot be null.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Parameter name: appEnv
at Microsoft.Data.Entity.Utilities.Check.NotNull[T](T value, String parameterName)
at Microsoft.Data.Entity.Commands.Program..ctor(IServiceProvider serviceProvider, IApplic
ationEnvironment appEnv, ILibraryManager libraryManager, IRuntimeEnvironment runtimeEnv)
这是我的 dnvm 列表:
PM> dnvm list
Active Version Runtime Architecture Location Alias
------ ------- ------- ------------ -------- -----
1.0.0-beta5 clr x64 C:\Users\user\.dnx\runtimes
1.0.0-beta5 clr x86 C:\Users\user\.dnx\runtimes
1.0.0-beta5 coreclr x64 C:\Users\user\.dnx\runtimes
1.0.0-beta5 coreclr x86 C:\Users\user\.dnx\runtimes
1.0.0-rc1-update1 clr x64 C:\Users\user\.dnx\runtimes
1.0.0-rc1-update1 clr x86 C:\Users\user\.dnx\runtimes default
* 1.0.0-rc1-update1 coreclr x64 C:\Users\user\.dnx\runtimes
1.0.0-rc1-update1 coreclr x86 C:\Users\user\.dnx\runtimes
我正在浏览这个,但到目前为止,这个新的 ASP.NET 似乎有很多错误。 http://docs.asp.net/en/latest/tutorials/your-first-aspnet-application.html
更新
dnu 构建输出
Build succeeded.
0 Warning(s)
0 Error(s)
Time elapsed 00:00:01.3991506
Total build time elapsed: 00:00:01.4070482
Total projects built: 1
PM>
和 dnu 恢复
PM> dnu restore
Microsoft .NET Development Utility CoreClr-x64-1.0.0-rc1-16231
CACHE https://www.nuget.org/api/v2/
Restoring packages for G:\Projectos\Tests\projx\project.json
GET https://www.nuget.org/api/v2/FindPackagesById()?id='System.Threading.ThreadPool'
OK https://www.nuget.org/api/v2/FindPackagesById()?id='System.Threading.ThreadPool' 722ms
Writing lock file G:\Projectos\Tests\projx\project.lock.json
Restore complete, 3023ms elapsed
NuGet Config files used:
C:\Users\user\AppData\Roaming\NuGet\nuget.config
Feeds used:
https://www.nuget.org/api/v2/
PM>
【问题讨论】:
-
作为 3k 代表用户,您至少应该学会如何发布正确的问题。不是吗?
-
所以你做了 dnu 构建步骤并且没有问题?你的 dnu 恢复同样没有问题?
-
我认为你的版本是错误的。即使活动是 coreclr,您的默认设置也显示为 clr。尝试明确告诉 dnvm/dnu/dnx 使用您的活动运行时 -
dnvm exec 1.0.0-rc1-update1 dnu build或者更新您的 -a 标志以使用 x86 而不是 x64... -
编辑:我认为你的版本是错误的。即使活动是 coreclr,您的默认设置也显示为 clr。尝试明确告诉 dnvm/dnu/dnx 使用您的活动运行时 -
dnvm exec 1.0.0-rc1-update1 -r coreclr dnu build或者更新您的 -arch 标志以使用 x86 而不是 x64...(ETA -r coreclr) -
@NovaDev,它成功了。
标签: asp.net asp.net-core