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

前端 未结 2 1510
说谎
说谎 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:51

    Yes you can. The following steps will cause .aspx files to be compiled as part of a normal builk invoked by the IDE, no Resharper plugin required.

    • Unload your web app (right click on the project and select ‘Unload Project’)
    • Open the .csproj file in a text editor (right click on the project and select ‘Edit myProjectName.csproj’)
    • At the bottom of the file find the comment which says ‘To modify your build process…’ and insert the following after that comment:

    Source - Compile Aspx pages at compile time using the AspNetCompiler build task

提交回复
热议问题