Initialized readonly field is null, why?
<p>Can anyone please explain, why "private readonly Int32[] _array = new[] {8, 7, 5};" can be null?</p>

<p>In this example, it works, and _array is always not null. But in my corporate code I have a simliar code and _array is always null. So I forced to declared it as static.</p>

<p>The Class is a partial Proxy Class from my WCF Contract.</p>

<pre><code>using System;
using System.ComponentModel;

namespace NullProblem
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var myClass = new MyClass();

            // Null Exception in coperate code
            int first = myClass.First;
            // Works
            int firstStatic = myClass.FirstStatic;
        }
    }

    // My partial implemantation
    public partial class MyClass
    {
        private readonly Int32[] _array = new[] {8, 7, 5};
        private static readonly Int32[] _arrayStatic = new[] {8, 7, 5};

        public int First
        {
            get { return _array[0]; }
        }

        public int FirstStatic
        {
            get { return _arrayStatic[0]; }
        }
    }

    // from WebService Reference.cs
    public partial class MyClass : INotifyPropertyChanged 
    {
        // a lot of Stuff

        #region Implementation of INotifyPropertyChanged

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion
    }

}
</code></pre>
