在命令行中使用 aspnet_compiler 抑制编译器警告

发布于 2024-07-22 04:30:27 字数 267 浏览 5 评论 0原文

在命令行使用 aspnet_compiler.exe 警告时是否有开关可以抑制特定的编译器警告?

我尝试自己修复错误,而不是忽略它们 - 它们适用于从未使用过的事件。 我只是注释掉了这些事件,但这引起了其他问题! 就好像它们已被使用但编译器无法识别(这似乎不太可能)。

我从命令行调用编译器,并且使用 Visual Web Developer Express,它在“项目属性生成”对话框中没有详细的生成选项,而这些选项可以在 Visual Studio 的完整版本中找到。

Is there a switch to suppress specific compiler warnings when using the aspnet_compiler.exe warnings at the command line?

I've tried fixing the errors myself, rather than ignoring them - they are for events that are defined by never used. I simply commented out the events, but this caused other problems! It's as if they are used but the compiler doesn't recognise that (which seems unlikely).

I'm calling the compiler from the command line, and I'm using Visual Web Developer Express, which does not have the detailed build options in the Project Properties Build dialog that can be found in the full version of Visual Studio.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

伤痕我心 2024-07-29 04:30:27

最后我

#pragma warning disable [warning no]
    some code that triggers a warning
#pragma warning enable [warning no]

在代码中使用了 http://msdn.microsoft .com/en-us/library/441722ys.aspx。 这工作得很好,虽然需要为每个编译器警告输入一次,但它似乎是最合适的。

In the end I used

#pragma warning disable [warning no]
    some code that triggers a warning
#pragma warning enable [warning no]

in my code, as per http://msdn.microsoft.com/en-us/library/441722ys.aspx. This works fine and although needs entering once for each compiler warning, it seems to be the best fit.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文