Razor View throwing “The name ‘model’ does not exist in the current context”

After significant refactoring in my MVC 4 application, and Razor shows this error while debugging Views:

The name ‘model’ does not exist in the current context.

This is the offending line of code:

@model ICollection<DataSourceByActive>

I know that the usage of @model is correct.

Why is this happening? How can I fix it?

25 Answers
25

Leave a Comment