dnu 恢复在 mac 上因 System.ArgumentException 失败:多个 runtime.json 文件已为 'osx.10.10-x64' 声明导入

dnu restore failed on mac with System.ArgumentException: More than one runtime.json file has declared imports for 'osx.10.10-x64'

当我 运行 dnu restore 在 mac 上解决我的问题时,我得到了这个错误:

----------
System.ArgumentException: More than one runtime.json file has declared imports for 'osx.10.10-x64'
Parameter name: runtimeName
  at Microsoft.Dnx.Tooling.RestoreCommand.FindRuntimeDependencies (System.String runtimeName, System.Collections.Generic.List`1 runtimeFiles, System.Collections.Generic.Dictionary`2 effectiveRuntimeSpecs, System.Collections.Generic.HashSet`1 allRuntimeNames, System.Func`2 circularImport) <0x2da4820 + 0x001a3> in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.RestoreCommand.FindRuntimeDependencies (System.String runtimeName, System.Collections.Generic.List`1 runtimeFiles, System.Collections.Generic.Dictionary`2 effectiveRuntimeSpecs, System.Collections.Generic.HashSet`1 allRuntimeNames) <0x2da4720 + 0x000cf> in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.RestoreCommand+<RestoreForProject>d__69.MoveNext () <0x2d46890 + 0x02767> in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x188f670 + 0x00035> in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x188cfa0 + 0x000b7> in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x188cf00 + 0x00087> in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x188ceb0 + 0x0003f> in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x1b859d0 + 0x0001f> 24211 in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.RestoreCommand+<>c__DisplayClass68_0+<<Execute>b__2>d.MoveNext () <0x2d46100 + 0x0017f> in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x188f670 + 0x00035> in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x188cfa0 + 0x000b7> in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x188cf00 + 0x00087> in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x188ceb0 + 0x0003f> in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () <0x188ce80 + 0x0001f> in <filename unknown>:0 
  at Microsoft.Dnx.Tooling.RestoreCommand+<Execute>d__68.MoveNext () <0x26f66b0 + 0x00ab3> in <filename unknown>:0 
----------
Restore failed
More than one runtime.json file has declared imports for 'osx.10.10-x64'
Parameter name: runtimeName

NuGet Config files used:
    /Users/myuser/.config/NuGet/nuget.config
    /Users/myuser/Documents/chatle/nuget.config

Feeds used:
    https://www.myget.org/F/aspnetvnext/api/v2/
    https://www.nuget.org/api/v2/

我使用来自 aspnetvnext feed 的最新不稳定 rc2

Active Version              Runtime Architecture OperatingSystem Alias
------ -------              ------- ------------ --------------- -----
       1.0.0-rc1-update1    mono                 linux/osx       
  *    1.0.0-rc2-16551      mono                 linux/osx       default

其他人得到了这个?
解决方案可以在 github

下载

您需要 imports dnxcore50 https://github.com/aspnet/Configuration/blob/a7320e6486fcdb8b03279f865250d4ac17676e3e/test/Microsoft.Extensions.Configuration.Test/project.json#L18

此外,您需要NetStandard.Library或NetCore.Platforms:https://github.com/aspnet/Configuration/blob/a7320e6486fcdb8b03279f865250d4ac17676e3e/test/Microsoft.Extensions.Configuration.Test/project.json#L10

您可能还会遇到一些错误,因为我们现在正在过渡到新的 TFM,而 dnx 目前无法正确处理它们。