ASP.net Web 窗体,在编译时出现 aspx/view 错误? [英] ASP.net Web Forms, get aspx/view errors at compile time?

查看:37
本文介绍了ASP.net Web 窗体,在编译时出现 aspx/view 错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这可以用 mvc2 来完成,但是有没有办法让 Visual Studio(2010)/resharper(6) 在编译时检查 aspx 页面上的错误并停止构建?Resharper 可以很好地检测错误,因此似乎应该有一种方法可以将所有 aspx 页面的检查集成到构建过程中.

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 can detect the errors just fine, so it seems like there should be a way to integrate a check of all the aspx pages in to the build process.

有什么建议吗?

推荐答案

是的,你可以.以下步骤将导致 .aspx 文件被编译为 IDE 调用的正常构建的一部分,不需要 Resharper 插件.

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.

  • 卸载您的网络应用(右键单击项目并选择卸载项目")
  • 在文本编辑器中打开 .csproj 文件(右键单击项目并选择编辑 myProjectName.csproj")
  • 在文件底部找到要修改您的构建过程..."的注释,然后在该注释后插入以下内容:

<Target Name="AfterBuild"><AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)"/></Target>

来源 - 使用 AspNetCompiler 构建任务在编译时编译 Aspx 页面

这篇关于ASP.net Web 窗体,在编译时出现 aspx/view 错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆