何らかの理由で、DNX と Kestrel を使用して、すぐに使用できるシンプルな ASP.NET 5 / Core 1.0 Web アプリを実行できません。実行後dnx web
、エラーが発生し続けます:
Error: Unable to load application or execute command 'Microsoft.AspNet.Server.Kestrel'. Available commands: web, ef.
私のproject.json:
{
"version": "1.0.0-*",
"userSecretsId": "aspnet5-WebApplication-635604fe-13b8-4779-8e12-35ec067b73ae",
"compilationOptions": {
"emitEntryPoint": true
},
"tooling": {
"defaultNamespace": "WebApplication"
},
"dependencies": {
"EntityFramework.Commands": "7.0.0-rc1-final",
"EntityFramework.Sqlite": "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.Dnx.Runtime":"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"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel",
"ef": "EntityFramework.Commands"
},
"frameworks": {
"dnx451": { },
"dnxcore50": { }
},
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
],
"publishExclude": [
"**.user",
"**.vspscc"
],
"scripts": {
"prepublish": [
"npm install",
"bower install",
"gulp clean",
"gulp min"
]
}
}
はい、dnu restore
以前走ったことがあります。これらのランタイムがインストールされています:
dnx-clr-win-x64.1.0.0-rc1-update1
dnx-clr-win-x64.1.0.0-rc1-update2
dnx-clr-win-x86.1.0.0-rc1-update1
dnx-clr-win-x86.1.0.0-rc1-update2
dnx-coreclr-win-x64.1.0.0-rc1-update2
誰かがこの問題がどこから来るのか知っていることを本当に願っています.
アップデート
依存関係とアセンブリ バインディングの解決に問題があるようです。実行するたびdnu build
に問題なくビルドされ、すべての nuget パッケージの依存関係が C:\users\*****\.dnx\packages で解決/復元されていることがわかります。
ただし、実行するdnx web
と、前述のエラーが発生し続けます。FusionLog を有効にしましたが、以前の nuget パッケージの依存関係が解決されていないようです。次のようなエラーが発生し続けます。
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNet.Hosting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.AspNet.Hosting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at WebApplication.Startup.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider)
at Microsoft.Dnx.ApplicationHost.Program.<>c__DisplayClass3_0.<ExecuteMain>b__0()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\Users\*****\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update2\bin\dnx.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.AspNet.Hosting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
(Fully-specified)
LOG: Appbase = file:///C:/Users/*****/.dnx/runtimes/dnx-clr-win-x86.1.0.0-rc1-update2/bin/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.AspNet.Hosting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
LOG: Fusion is hosted. Check host about this assembly.
LOG: Try host assembly store with assembly microsoft.aspnet.hosting, version=1.0.0.0, culture=neutral, publickeytoken=adb9793829ddae60, processorarchitecture=x86.
LOG: Try host assembly store with assembly microsoft.aspnet.hosting, version=1.0.0.0, culture=neutral, publickeytoken=adb9793829ddae60, processorarchitecture=msil.
LOG: Try host assembly store with assembly microsoft.aspnet.hosting, version=1.0.0.0, culture=neutral, publickeytoken=adb9793829ddae60.
WRN: Host assembly store does not contain this assembly.
LOG: Attempting download of new URL file:///C:/Users/*****/.dnx/runtimes/dnx-clr-win-x86.1.0.0-rc1-update2/bin/Microsoft.AspNet.Hosting.DLL.
LOG: Attempting download of new URL file:///C:/Users/*****/.dnx/runtimes/dnx-clr-win-x86.1.0.0-rc1-update2/bin/Microsoft.AspNet.Hosting/Microsoft.AspNet.Hosting.DLL.
LOG: Attempting download of new URL file:///C:/Users/*****/.dnx/runtimes/dnx-clr-win-x86.1.0.0-rc1-update2/bin/Microsoft.AspNet.Hosting.EXE.
LOG: Attempting download of new URL file:///C:/Users/*****/.dnx/runtimes/dnx-clr-win-x86.1.0.0-rc1-update2/bin/Microsoft.AspNet.Hosting/Microsoft.AspNet.Hosting.EXE.
だから私は今、問題がどこにあるかを知っています。これは解決策ではありませんが、必要なdllを一時的にコピーする/C:/Users/*****/.dnx/runtimes/dnx-clr-win-x86.1.0.0-rc1-update2/bin
と、問題が解決するようです。
更新 2
問題は clr ランタイムにあるようです。dnvm use 1.0.0-rc1-update1 -a x86 -r coreclr
cmdに続けてを入力して coreclr を使用するdnx web
と、アプリは問題なく動作します。
clr を再インストールして、x64 と x86 の両方に update1 と update2 の両方をインストールしようとしましたが、エラーは残ります。coreclr だけが機能しているようです。アイデアはありますか?