Some times compiler could not point on exact lines having specific kind of errors in razor view may be because it could not keep their line number in stack trace or somewhere. I have found this case with Null Reference Exception and when null is passed in Url.Content.
So it helps to check the next C# statement in razor view when you did not get any error on the line shown by stack trace.