ASP.NET Core NullReferenceException when just accessing model
I am having trouble with attempting to create a view with a strongly typed model. No matter what I pass in as the model to a View() , I always receive a NullReferenceException when even just accessing the Model . I can't even check if the model is null before executing the rest of the razor page; simply doing a if (Model != null) also throws the same NullReferenceException . Index.cshtml @page @model EncodeModel @{ Layout = "~/Pages/Shared/_Layout.cshtml"; } <h2>Encode</h2> <div id="progress"> @await Html.PartialAsync("~/Encoder/MVC/EncodeProgress.cshtml", new EncodeModule()) </div>