VS2015 / DNX从github构建Microsoft.Framework.Logging会导致测试错误

时间:2015-08-12 18:26:57

标签: asp.net visual-studio-2015 asp.net-core xunit dnx

所以我安装了VS2015企业版。我从github获取最新的Microsoft.Framework.Logging,加载解决方案并构建它。

在恢复所有依赖包之后,它确实构建好了但是我在测试时遇到了这个错误:

Starting Microsoft.Framework.TestHost [C:\Users\dan_000\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta6\bin\dnx.exe --appbase "D:\code\DanForks\Logging\test\Microsoft.Framework.Logging.Test" Microsoft.Framework.ApplicationHost --port 1388 Microsoft.Framework.TestHost --port 5651] System.InvalidOperationException: Unable to load application or execute command 'Microsoft.Framework.TestHost'. Available commands: run, test. at Microsoft.Framework.ApplicationHost.Program.ThrowEntryPointNotfoundException(DefaultHost host, String applicationName, Exception innerException) at Microsoft.Framework.ApplicationHost.Program.ExecuteMain(DefaultHost host, String applicationName, String[] args) at Microsoft.Framework.ApplicationHost.Program.Main(String[] args) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider) at dnx.host.Bootstrapper.RunAsync(List``1 args, IRuntimeEnvironment env, FrameworkName targetFramework) at dnx.host.RuntimeBootstrapper.ExecuteAsync(String[] args, FrameworkName targetFramework) at dnx.host.RuntimeBootstrapper.Execute(String[] args, FrameworkName targetFramework)

当我在DNX_TRACE = 1的命令提示符下运行相同的命令时,我得到:

Test" Microsoft.Framework.ApplicationHost --port 1388 test --port 1462 The servicing index file at: C:\Program Files (x86)\Microsoft DNX\Servicing\index.txt does not exist or could not be opened. Loaded module: dnx.clr.dll Found export: CallApplicationMain Information: [DomainManager] Using Desktop CLR v4.5.1 Information: [Bootstrapper] Runtime Framework: DNX,Version=v4.5.1 Information: [DefaultHost]: Project path: D:\code\DanForks\Logging\test\Microsoft.Framework.Logging.Test Information: [DefaultHost]: Project root: D:\code\DanForks\Logging Information: [DefaultHost]: Packages path: C:\Users\dan_000\.dnx\packages Information: [DependencyWalker]: Walking dependency graph for 'Microsoft.Framework.Logging.Test DNX,Version=v4.5.1'. Information: [WalkContext]: Graph walk stage 1 took in 28ms Information: [DependencyWalker]: Graph walk took 31ms. Information: [ServicingIndex]: Servicing index not found at C:\Program Files (x86)\Microsoft DNX\Servicing\index.txt Information: [WalkContext]: Populate took 15ms Information: [DependencyWalker]: Resolved dependencies for Microsoft.Framework.Logging.Test in 49ms Information: [LoaderContainer]: Load name=xunit.runner.aspnet Information: [NuGetAssemblyLoader]: Loaded name=xunit.runner.aspnet in 5ms Information: [LoaderContainer]: Load name=xunit.runner.utility.AspNet, Version=99.99.99.0, Culture=neutral, PublicKeyToken=null Information: [NuGetAssemblyLoader]: Loaded name=xunit.runner.utility.AspNet, Version=99.99.99.0, Culture=neutral, PublicKeyToken=null in 1ms Information: [LoaderContainer]: Load name=xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c Information: [NuGetAssemblyLoader]: Loaded name=xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c in 1ms Information: [LoaderContainer]: Load name=Microsoft.Dnx.Runtime.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null Information: [NuGetAssemblyLoader]: Loaded name=Microsoft.Dnx.Runtime.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null in 1ms System.NullReferenceException: Object reference not set to an instance of an object. at Xunit.Runner.AspNet.Program.Main(String[] args) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider) at Microsoft.Framework.ApplicationHost.Program.ExecuteMain(DefaultHost host, String applicationName, String[] args) at Microsoft.Framework.ApplicationHost.Program.Main(String[] args) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider) at dnx.host.Bootstrapper.RunAsync(List``1 args, IRuntimeEnvironment env, FrameworkName targetFramework) at dnx.host.RuntimeBootstrapper.ExecuteAsync(String[] args, FrameworkName targetFramework) at dnx.host.RuntimeBootstrapper.Execute(String[] args, FrameworkName targetFramework)

我的解决方案所有项目的DNX版本都是1.0.0-beta6。

我对xunit的所有功能都不是很熟悉。我想我某处有某种运行时不匹配?

1 个答案:

答案 0 :(得分:0)

我认为其中一个依赖性变化打破了xunit runner。我认为你必须等待xunit更新参考或代码来解决这些变化。此外,不同版本的xunit也会针对不同的dnx。确保将xunit更新到xUnit.net 2.1 Beta 4 http://xunit.github.io/docs/getting-started-dnx.html