简体   繁体   English

VB.Net项目在VS2010中显示清理错误

[英]VB.Net project shows errors on clean in VS2010

my issue is very similar to: 我的问题非常类似于:

http://www.dotnetmonster.com/Uwe/Forum.aspx/dotnet-vb/54944/VB-Net-project-throwing-errors-when-executing-Clean-Solution http://www.dotnetmonster.com/Uwe/Forum.aspx/dotnet-vb/54944/VB-Net-project-throwing-errors-when-executing-Clean-Solution

  1. Typical errors: Unable to load referenced library X 典型错误:无法加载引用的库X
  2. Type IWshRuntimeLibrary.WshShell is not defined. 未定义类型IWshRuntimeLibrary.WshShell。
  3. Interface System.IDisposable is not implemented by this class. 此类未实现接口System.IDisposable。
  4. Namespace of type specified in the Imports Z does not contain any public members or cannot be found. Imports Z中指定的类型的名称空间不包含任何公共成员,或者找不到。 Make sure the imported element name does not use any aliases. 确保导入的元素名称不使用任何别名。

This must have to do with a VB.net project configuration. 这必须与VB.net项目配置有关。 Currently there is a setting "Treat all warnings as errors". 当前有一个设置“将所有警告视为错误”。 I would like to keep that setting, but also resolve these annoying "errors". 我想保留该设置,但还要解决这些烦人的“错误”。

我遇到了类似的问题,并通过在VS命令行工具中运行以下命令来解决此问题

devenv /resetskippkgs

I'ev had problems executing Clean's via MSBuild in VS2008 when projects were registered for COM interop. 当为COM interop注册项目时,我在VS2008中通过MSBuild执行Clean的问题。

The problem is that the "Clean" target auto-generated for a solution cleans projects in the same order in which they were built. 问题在于,为解决方案自动生成的“清理”目标会按照生成项目的顺序来清理项目。

This causes problems for projects registered for COM when MSBuild attempts to load and then unregister the assembly from COM during a "Clean".The issue occurs if the assembly has a dependency on another project because the dependency will be deleted first and therefore loading the assembly will fail and MSBuild will be unable to unregister it. 当MSBuild尝试加载然后在“清理”期间从COM取消注册程序集时,这会导致为COM注册的项目出现问题。如果程序集对另一个项目有依赖关系,则会发生此问题,因为该依赖关系将首先删除并因此加载程序集将失败,MSBuild将无法注销它。

A workaround is to change the solution .cache file (which contains the targets auto-generated by MSBuild during "Build") and reverse the order of the "Clean" target. 一种解决方法是更改​​解决方案.cache文件(该文件包含MSBuild在“生成”过程中自动生成的目标),并反转“清理”目标的顺序。 I hacked-together a quick-fix custom build task to do this as a post-build step. 我将一个快速修复的自定义构建任务整合在一起,以此作为构建后的步骤。

No idea if this was fixed in VS2010 or indeed if this matches your problem since you don't give many specifics in your question ;) 不知道这是在VS2010中修复的还是确实与您的问题匹配,因为您没有在问题中提供很多细节;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM