Skip to content
This repository was archived by the owner on Nov 9, 2018. It is now read-only.
This repository was archived by the owner on Nov 9, 2018. It is now read-only.

System.InvalidOperationException: Object reference not set to an instance of an object. #116

@scottengle

Description

@scottengle

I am getting the following error message when building my test project:

------ Discover test started ------ ------ Test started: Project: AdminTools.Tests ------ Starting Microsoft.Framework.TestHost [C:\Users\sengle\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta6-11941\bin\dnx.exe --appbase "C:\projects\AdminTools\test\AdminTools.Tests" Microsoft.Framework.ApplicationHost --port 21564 Microsoft.Framework.TestHost --port 41925 list ] Connected to Microsoft.Framework.TestHost Discovering tests in 'C:\projects\AdminTools\test\AdminTools.Tests\project.json' Error discovering tests in 'C:\projects\AdminTools\test\AdminTools.Tests\project.json' System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Object reference not set to an instance of an object. --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at Microsoft.VisualStudio.Web.UnitTest.TestAdapter.Discovery.HostExtensions.GetTests(IHost host, ITestCaseDiscoverySink discovery, IMessageLogger logger, KRuntimeConfiguration testConfiguration) at Microsoft.VisualStudio.Web.UnitTest.TestAdapter.KUnitTestDiscoverer.GetTestCases(IEnumerable`1 sources, IMessageLogger logger, ITestCaseDiscoverySink discoverySink) ---> (Inner Exception #0) System.InvalidOperationException: Object reference not set to an instance of an object.<--- ========== Discover test finished: 0 found (0:00:02.3672367) ========== 

I'm running DNX 1.0.0-beta6-11941. Here are the contents of my test project.json. When I don't include the TestHost and ApplicationHost dependencies, I can't connect to the TestHost:

{ "version": "1.0.0-*", "dependencies": { "AdminTools": "1.0.0-*", "xunit": "2.1.0-*", "xunit.runner.dnx": "2.1.0-*", "Microsoft.Framework.TestHost": "1.0.0-*", "Microsoft.Framework.ApplicationHost": "1.0.0-*" }, "frameworks": { "dnx451": { } }, "commands": { "test": "xunit.runner.dnx" } } 

The contents of my test file:

 public class TestController { [Fact] public void PassingTest() { Assert.Equal(true, true); } } 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions