I get the following error when wrapping my model with ViewPage
Property ‘ViewData’ is of type ‘Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary1[[Alert.Web.ServiceModel.Types.Entity, Alert.Web.ServiceModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]', but this method requires a value of type 'Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary1[[System.Object, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]’. Parameter name: viewContext
This issue resolved for my main for the page in question but I have other views in the Views folder that now display this same error. I have another copy of _viewImports.cshtml in the directory but that hasn’t resolved the problem.
Note we don’t have control over ASP.NET Core MVC’s Razor implementation which is used to render Razor views in .NET Core, if you’re running into another limitation of .NET Core’s implementation.
But if you can put together a stand-alone repro I can run locally to reproduce the issue, I can spend some time looking into it to see if I can find another workaround.
I’d prefer not to have any access to any confidential source code. Can’t you isolate the issue into a small stand-alone repro that doesn’t contain any sensitive info? We’re not going to be able to change the behavior as all compilation inc _ViewImports.cshtml and _ViewStart.cshtml is all handled internally by MVC, but if I had a small stand-alone repro I can at least spent some time trying to debug and try some trial/error to see if there’s any potential workarounds, but this would be much harder if this was part of a bigger project, instead of the Minimal, Complete, and Verifiable example needed.
I have narrowed the issue to trying to include the AutoGrid partial onto my page. Removing it renders the page properly. I couldn’t find any examples of NetCoreApps using the AutoGrid so maybe it behaves differently with netCore.