ASP.NET error NullReferenceException: Object reference not set to an instance of an object : <p>This is my first MVC project and I'm stuck. When I try to run my project, I'm getting NullReferenceException: 'Object reference not set to an instance of an object.' in my Index View at the foreach line. Any idea why and what I need to do to fix it.</p>

<p>This configuration was also included all the configuration.</p>

<p>.cshtml File is here: 
@model IEnumerable
  ===>           foreach (var echipament in Model )  &lt;====== HERE IS THE ERROR
            This is the Controller class:</p>

<pre><code>    public ViewResult List()
    {        var echipamente=_echipamentRepository.Echipamente;
        return View(echipamente);
    }
}
</code></pre>

<p>Can you please help me to solve this error?</p>
