ASP.net Web Forms, get aspx/view errors at compile time?

前端 未结 2 1511
说谎
说谎 2020-12-31 05:23

I know this can be done with mvc2, but is there any way for visual studio(2010)/resharper(6) to check for errors on aspx pages at compile time and halt the build? Resharper

2条回答
  •  执念已碎
    2020-12-31 05:48

    You probably don't want to do this at compile time because compiling views is slow...

    What you really want to do is have a NAnt (or something else) task that will XML poke this target into your web .csproj file prior to compiling the source code on your CI server.

    This way your developers don't have to put up with the time wasting of the AspNetCompiler every time they do CTRL+SHIFT+B locally in Visual Studio, but you can still alert people to views with syntax errors on the CI server by failing the CI build.

    Update: Here is a method that will run your view build outside of Visual Studio, but still on your local PC :)

    http://www.luisrocha.net/2011/10/avoiding-mvcbuildviews-build-time.html

提交回复
热议问题