My background: I have a file with a large number of lines that cause this warning (where this specific warning is meaningless to me because the array sizes are identical).
To rule out some obscure project settings, I created a simple toy example. Here, I use the rule set "Microsoft All Rules". The following still gives me warnings, including CA1814:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
#pragma warning disable 1814
var test = new int[0,0,0];
var b = new Banana();
#pragma warning restore 1814
return;
}
}
class Banana : IDisposable
{
public void Dispose()
{
Console.WriteLine("What a waste");
}
}
}
I'm not sure if this is somehow related, but even with all these errors, I can build the project fine using Warning level: 4, Treat warnings as errors: "All".
edit: I also tried CA1814 instead of just 1814