question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullReferenceException thrown during testFromAssembly

See original GitHub issue

I’m getting a nullref exception during testFromAssembly. Full stacktrace:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicFunctions.UnboxGeneric[T](Object source)
   at Expecto.Impl.getTestFromMemberInfo@1138-1.Invoke(a focusedState)
   at Microsoft.FSharp.Core.OptionModule.Map[T,TResult](FSharpFunc`2 mapping, FSharpOption`1 option)
   at Expecto.Impl.testFromMember(MemberInfo mi)
   at Microsoft.FSharp.Collections.Internal.IEnumerator.choose@165.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
   at Expecto.Impl.testFromType@1167.Invoke(Type t)
   at Microsoft.FSharp.Collections.Internal.IEnumerator.choose@165.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
   at Expecto.Impl.testFromAssemblyWithFilter(FSharpFunc`2 typeFilter, Assembly a)
   at YoloDev.Expecto.TestSdk.Discovery.discoverTests@143.GenerateNext(IEnumerable`1& next) in /Users/alxandr/hub/YoloDev.Expecto.TestSdk/src/YoloDev.Expecto.TestSdk/adapter.fs:line 149
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()
   at Microsoft.FSharp.Collections.SeqModule.Iterate[T](FSharpFunc`2 action, IEnumerable`1 source)
   at YoloDev.Expecto.TestSdk.VsTestAdapter.Microsoft-VisualStudio-TestPlatform-ObjectModel-Adapter-ITestDiscoverer-DiscoverTests(IEnumerable`1 sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink) in /Users/alxandr/hub/YoloDev.Expecto.TestSdk/src/YoloDev.Expecto.TestSdk/adapter.fs:line 200

Running on dotnet core 2.0 on OSX

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:22 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
Alxandrcommented, Oct 17, 2017

Btw; I have a (seemingly) working runner for vstest (the new one) available at https://github.com/YoloDev/YoloDev.Expecto.TestSdk. Let me know if this is something you’re interested in adopting.

Also, if you’re not, I’m using a bunch of “internal” (Expect.Impl) apis, and I don’t see how I could not currently, so Expecto might need a bigger API surface if Expecto.Impl is not supposed to be used.

It’s currently in a very early state. It does not support filters or any such. Need to figure out how that works first.

image

0reactions
AnthonyLloydcommented, Oct 20, 2017

Closing and opening a new issue for this. Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Detecting what the target object is when ...
As a few answers have pointed out, tell Visual Studio to break on Throw for NullReferenceException. How to tell VS to break when...
Read more >
How can I fix the error: System.NullReferenceException
A NullReferenceException exception is thrown when you try to access a member on a type whose value is null. A NullReferenceException exception ......
Read more >
NullReferenceException Class (System)
The exception that is thrown when there is an attempt to dereference a null object reference.
Read more >
How to avoid NullReferenceException in C# | RIMdev Blog
This exception is thrown when you try to access any properties / methods/ indexes on a type of object which points to null....
Read more >
Object Reference Not Set to an Instance of an Object
This infamous and dreaded error message happens when you get a NullReferenceException. This exception is thrown when you try to access a member—for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found