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 错误?
- C#MongoDB使用Builders查找派生对象 2022-09-04
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- 输入按键事件处理程序 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
