为什么是“找不到引用的组件'X'."被视为警告? [英] Why is "The referenced component 'X' could not be found." considered a warning?

查看:46
本文介绍了为什么是“找不到引用的组件'X'."被视为警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道,为什么...... VS 团队是否认为不找到项目参考是不重要的事情?

I wonder, why the hell... did the VS team consider that NOT finding a project reference as a non crucial thing?

无法找到引用的组件X".应该被认为是一个错误......没有别的.

The referenced component 'X' could not be found. should be considered an error... and nothing else.

有没有办法(不打开将所有警告视为错误")将此警告视为 VS2008 中的错误?

推荐答案

该警告来自项目系统,而不是编译器.项目系统不知道在编译代码时是否实际需要引用.我遇到过几种情况(都涉及多个平台和条件编译),其中此功能允许您维护单个项目文件,否则您可能不得不将每个配置拆分为一个文件.

That warning comes from the project system, not the compiler. The project system doesn't know whether or not the reference will actually be needed when the code is compiled. I've run into several cases (all involving multiple platforms and conditional compilation) where this features allows you to maintain a single project file when you might otherwise have to split into one file per configuration.

有一个选项可以将警告视为错误"——您应该可以在项目配置屏幕中找到它.

There is an option to "treat warnings as errors" -- you should be able to find it in the project configuration screen.

这篇关于为什么是“找不到引用的组件'X'."被视为警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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