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 错误?
基础教程推荐
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- WPF 模态进度窗口 2022-01-01
