ASP.net Web Forms, get aspx/view errors at compile time?(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 错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:ASP.net Web 窗体,在编译时出现 aspx/view 错误?
基础教程推荐
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
