Breaking my head around with this, yesterday it worked fine and today it seems to be broken:
This line is generating the error:
@if (Roles.IsUserInRo
For my use case, adding the following line in the web.config file fixed it!