为什么执行 .Net 2.0 构建干净的解决方案会导致错误?
我有一个创建 DLL 的 .net 解决方案。 它由两个项目组成。 (辅助信息,第一个包含我用 VB.Net 编写的许多特殊函数/类等。第二个是一些特定于客户端的函数/类等,这些函数/类使用我的类)在一些这个和那个以及其他之后我可以毫无问题地构建和重建解决方案。 没有错误、警告等。
我检查了项目依赖项,它们是正确的。 例如,我的代码不依赖于客户端代码,但客户端代码确实依赖于我的代码。 构建顺序:我的代码然后是客户端代码。 这一切对我来说看起来都很好。
现在,为了真正确保一切正常,我执行了“构建>清洁解决方案”。 导致以下问题: 1 个警告(找不到参考组件 ADODB) 6 个错误(所有错误都在我的代码中,它们以 ADODB 引用为中心)
我可以看到我的代码中的 ADODB 引用上有一个警告图标。 但是我刚刚发现,如果我双击该图标(在解决方案资源管理器中),则会显示对象浏览器并且警告消失。
如果现在我进行两次重建,错误就会消失,一切都会很高兴。
底线问题:
- 为什么构建干净的解决方案会导致这些警告和问题?
- 我该怎么做才能避免这些问题发生
I have a .net Solution that creates a DLL. It it made up of two projects. (Side information one contains a number of my special functions/classes etc. written in VB.Net. The second is some functions/classes etc. that are specific to a client and these use my classes) After some this and that and the other work I can build and rebuild the solution with no trouble. No error, warnings etc.
I check the project dependancies and they are correct. E.g. my code does not depend on the client code, but the client code does depend on my code. Build order: My code then client code. That all looks good to me.
Now just to be really sure that everything is ok I do a Build>Clean Solution. The following issues result:
1 warning (The reference componet ADODB could not be found)
6 Errors (All the errors are in my code and they center around the ADODB reference)
I can see that the ADODB reference in my code has a warning icon on it. However I just found that if I double click on the icon (in the solution explorer) The object browser is shown and the warning goes away.
If now I do two rebuilds the errors go away and everthing is happy.
Bottom line questions:
- Why is doing a Clean solution build causing these warnings and issues?
- What can I do so that these issues stop happening
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
(编辑以尝试尊重您实际提出的两个问题)
我遇到了黄色警告图标,链接到第三方控件的特定版本。 我针对一个版本引用了它,然后用新的 DLL 替换了该 DLL,并得到了警告图标。 将引用的“特定版本”属性更改为“False”可以解决问题(就像将其保留为“True”并更改所引用的版本号一样)
干净的构建可能会删除存储的配置,其中可能包括您忽略了有关 ADODB 的警告。
也许您正在引用 ADODB 的特定版本,并且应该更改它以忽略版本号,或者更新版本号。
(edited to try and respect the 2 questions you actually asked)
The yellow warning icon happened to me linking to a specific version of a third-party control. I referenced it against one version, then replaced the DLL with a new one and got the warning icon. Changing the "Specific Version" property of the reference to "False" got rid of the problem (as would leaving it "True" and changing the version number that is being referenced)
Clean build perhaps erases stored configuration, which may include you ignoring the warning about ADODB.
Maybe you are making reference to a specific version of ADODB, and should change it either to ignore version number, or update the version number.
我通常会尽量避免在 .NET 项目中使用 COM 对象。 您可能已经找到了我偏爱的原因之一。 ;-)
这两个项目都引用了 ADODB 吗? 它们都引用该对象的同一版本吗?
I generally try to avoid using COM objects in .NET projects. You may have found one of the reasons for my preference. ;-)
Do both projects reference ADODB? Do they both reference the same version of the object?