Skip to content

System.InvalidOperationException expect model 'A' but received model 'A' issue in 1.8 #84

@tranthanhvan

Description

@tranthanhvan

Hi theres. I have encounted problem that I really can't understand.

CS code is very simple :
await RazorTemplateEngine.RenderAsync(viewName, viewModel);

that code above throw exception say : "The model item passed into the ViewDataDictionary is of type 'Miscellaneous.MiscellaneousInvoiceViewModel', but this ViewDataDictionary instance requires a model item of type 'Miscellaneous.MiscellaneousInvoiceViewModel'."

However the problem does not occur immediately when the application starts. which will happen sometime later (1 month, 2 months after). Means when the application has been running for a while. And until when i restart the app, everything is normal again.

I also find out case the same problem in there. But i am not have RazorTemplateEngine.Initialize() in my code.

I would be very grateful if you could help

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions