DNX451 assemlyBinding重定向失败

时间:2016-04-20 18:39:41

标签: c# asp.net-core clr dnx assemblybinding

每当我尝试在具有默认clr运行时的DNX451应用程序上运行dnudnx命令时,我会不断收到程序集绑定错误,如下所示:

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

我运行了以下cmd:

  1. yo aspnet(自耕农) - >空应用
  2. dnu restore

0 个答案:

没有答案