Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Is there a way for Visual Studio (I'm using 2010) to find errors within razor views during builds, in the same way as other code in a C# project would?

It's just a pain that you can check any errors in your code and think that everything's fine, but it appears that you can't be sure about views unless you go through each one.

BTW I obviously don't code in my views - I'm just talking about HTML or URL extension methods for example.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
121 views
Welcome To Ask or Share your Answers For Others

1 Answer

Try setting MVCBuildViews to true in your project file (i.e. edit your csproj file)

 <MvcBuildViews>true</MvcBuildViews>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...