title: How can I avoid this potential "run-time exception on write operation"?
body: <p>With this code:</p>
  
  <pre><code>for (int row = 0; row &lt; PlatypusGridRowCount; row++) {
      // Save each row as an array
      var currentRowContents = new string[ColumnCount];
      // Add each column to the currentColumn
      for (int col = 0; col &lt; ColumnCount; col++) {
          currentRowContents[col] = this.GetPlatypusValForCell(row, col);
  }
  // Add the row to the DGV
  dataGridViewPlatypus.Rows.Add(currentRowContents);
  </code></pre>
  
  <p>Resharper says about the last line: "Co-variant array conversion from string[] to object[] can cause run-time exception on write operation"</p>
  
  <p>So I let it make the change it wants to ("Change type of local variable to object[] ...") so that the code becomes this:</p>
  
  <pre><code>...
      object[] currentRowContents = new string[ColumnCount];
  ...
  </code></pre>
  
  <p>Then, when I rerun the Resharper inspection, I get the exact same exact warning message again from Resharper ("Co-variant array conversion from string[] to object[] can cause run-time exception on write operation"), but this time on the line:</p>
  
  <pre><code>object[] currentRowContents = new string[ColumnCount];
  </code></pre>
  
  <p>I then let it do its thing again ("change type of local variable to string[]...")</p>
  
  <p>...so this changes that line to:</p>
  
  <pre><code>string[] currentRowContents = new string[PLATYPUS_COL_COUNT];
  </code></pre>
  
  <p>...(IOW, it changes it back to the first version, but with an explicit rather than implicit string array declaration); but a subsequent run of ReSharper will want me to change string[] to var, etc.</p>