'FakeItEasy.Analyzer.RepeatedAssertionAnalyzer' threw an exception of type 'System.NullReferenceException'
See original GitHub issueFIE v4.5.0
The CS8032
disappeared after restarting VS 2017 already upgraded to 4.5.0 (from 4.4.0)
Severity Code Description Project File Line Suppression State Detail Description
Warning AD0001 Analyzer 'FakeItEasy.Analyzer.RepeatedAssertionAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'. XXX.Tests D:\Source\XXX.Tests\CSC 1 Active
Warning CS8032 An instance of analyzer FakeItEasy.Analyzer.RepeatedAssertionAnalyzer cannot be created from C:\Users\XXX\.nuget\packages\fakeiteasy.analyzer.csharp\4.5.0\analyzers\dotnet\cs\FakeItEasy.Analyzer.CSharp.dll: Could not load type 'FakeItEasy.Analyzer.RepeatedAssertionAnalyzer' from assembly 'FakeItEasy.Analyzer.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=eff28e2146d5fd2c'.. XXX.Tests 1 Active System.TypeLoadException: Could not load type 'FakeItEasy.Analyzer.RepeatedAssertionAnalyzer' from assembly 'FakeItEasy.Analyzer.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=eff28e2146d5fd2c'.
at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)
at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.Extensions`1.GetAnalyzersForTypeNames(Assembly analyzerAssembly, IEnumerable`1 analyzerTypeNames, Boolean& reportedError)
-----
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
TopLevelParameterNameAnalyzer threw an exception of ...
Mvc.Analyzers.TopLevelParameterNameAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set ...
Read more >c# - What is a NullReferenceException, and how do I fix it?
I have some code and when it executes, it throws a NullReferenceException , saying: Object reference not set to an instance of an...
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 >Random error with SonarAnalyzer - SonarQube
Hello,. We are using SonarAnalyzer.CSharp version 8.26.0.34506 as nuget package and when randomly analyze our code it throws this exception:
Read more >How to Fix NullReferenceException in C#! (4 Step Process)
Let's learn what is a NullReferenceException, what causes it and a Step-by-Step process for how to Fix NullReferenceException in C#! ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK, I understand now. It’s not
ILaundryAnalyzer.InitializeAsync
that is considered an invocation expression, butnameof(ILaundryAnalyzer.InitializeAsync)
.nameof
is a contextual keyword; it’s considered a keyword only if there’s no method called “nameof”. From a syntactic point of view,nameof(ILaundryAnalyzer.InitializeAsync)
is a invocation expression: it will resolve to a method call if a method called “nameof” is in scope.This change has been released as part of FakeItEasy 4.5.1. Thanks, @Mertsch. Look for your name in the release notes! 🏆