每当我尝试在具有默认 clr 运行时的 DNX451 应用程序上运行dnu
或命令时,我都会不断收到程序集绑定错误,如下所示:dnx
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Dnx.Tooling' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Dnx.Tooling'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at Microsoft.Dnx.Runtime.Loader.LoadContext.Load(AssemblyName assemblyName)
at Microsoft.Dnx.Host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment env, String appBase, FrameworkName targetFramework)
at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, BootstrapperContext bootstrapperContext)
at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, BootstrapperContext bootstrapperContext)
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.Dnx.Tooling
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Microsoft.Dnx.Tooling | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Users/*****/.dnx/runtimes/dnx-clr-win-x86.1.0.0-rc1-update2/bin/
LOG: Initial PrivatePath = NULL
Calling assembly : Microsoft.Dnx.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60.
===
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: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/*****/.dnx/runtimes/dnx-clr-win-x86.1.0.0-rc1-update2/bin/Microsoft.Dnx.Tooling.DLL.
LOG: Attempting download of new URL file:///C:/Users/*****/.dnx/runtimes/dnx-clr-win-x86.1.0.0-rc1-update2/bin/Microsoft.Dnx.Tooling/Microsoft.Dnx.Tooling.DLL.
LOG: Attempting download of new URL file:///C:/Users/*****/.dnx/runtimes/dnx-clr-win-x86.1.0.0-rc1-update2/bin/Microsoft.Dnx.Tooling.EXE.
LOG: Attempting download of new URL file:///C:/Users/*****/.dnx/runtimes/dnx-clr-win-x86.1.0.0-rc1-update2/bin/Microsoft.Dnx.Tooling/Microsoft.Dnx.Tooling.EXE.
它似乎在当前文件路径中查找 dll,而不是在 lib 或 packages 文件夹中。然后它只是停止执行命令。
每当我将所需的 dll 粘贴到 bin 中时,它似乎都可以作为临时解决方法,但这不是数十个 dll 的选项......
奇怪的是,coreclr 运行时不会出现这个问题,只有默认的 clr 才会出现这个问题。
有谁知道为什么会这样?我在另一台机器上尝试过,它也抛出了融合日志,但似乎运行得很好。
更新信息
dnvm list
Active Version Runtime Architecture OperatingSystem Alias
------ ------- ------- ------------ --------------- -----
* 1.0.0-rc1-update2 clr x86 win default
1.0.0-rc1-update2 coreclr x64 win
1.0.0-rc1-update2 coreclr x86 win
我运行了以下命令:
yo aspnet
(约曼)-> 空应用程序dnu restore