I'm trying to use this analyser ( I wrote it )
https://www.nuget.org/packages/Weingartner.Json.Migration.Analyzer/ https://github.com/Weingartner/Migrations.Json.Net
I apply it against this source file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using Weingartner.Json.Migration;
namespace testjson
{
[DataContract]
[Migratable("")]
public class Class1
{
[DataMember]
public int foo { get; set; }
}
}
and I see the following warning in the output.
1>CSC : warning CS8032: An instance of analyzer Weingartner.Json.Migration.Roslyn.MigrationHashAnalyzer cannot be created from C:\Users\phelan\workspace\testjson\packages\Weingartner.Json.Migration.Analyzer.1.0.4\analyzers\dotnet\cs\Weingartner.Json.Migration.Roslyn.dll : Method 'get_SupportedDiagnostics' in type 'Weingartner.Json.Migration.Roslyn.MigrationHashAnalyzer' from assembly 'Weingartner.Json.Migration.Roslyn, Version=1.0.6246.21734, Culture=neutral, PublicKeyToken=null' does not have an implementation..
which is quite strange because if I crack open the DLL with JustDecompile I see
[DiagnosticAnalyzer("C#", new string[] { })]
public class MigrationHashAnalyzer : DiagnosticAnalyzer
{
<snip>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
{
get
{
return ImmutableArray.Create<DiagnosticDescriptor>(MigrationHashAnalyzer.Rule);
}
}
<snip>
}
which is what I expect because the source for the analyzer compiles. If the method was really missing then it wouldn't compile.
Why would VS report a method missing when it is really there?