I am getting a CS0246 error code. I am doing a MVC .net core project. I am incorporating Razor in my C# code. I received this error having doing a build. I am getting an error on the last line. Could anyone help me figure this out?
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"d6a5625cc8fb4476f348b0fe9041c550465d8bf9", @"/Views/Shared/Error.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"53c99bf587b2b24ba6d4f1516a026a5e81271c09", @"/Views/_ViewImports.cshtml")]
public class Views_Shared_Error : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<ErrorViewModel>
In Error.cshtml page add @model libraryname.ErrorViewModel at the top of the page instead of just ErrorViewModel. Then rebuild the project and see if it works.
The newly added using directive will looks like this - using [something].Models
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With