Visual Studio Build似乎不使用当前项目 [英] Visual Studio Build seems not to use current projects

查看:77
本文介绍了Visual Studio Build似乎不使用当前项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2017 Enterprise,C#4.7.2

I am using Visual Studio 2017 Enterprise, C# 4.7.2

我的解决方案当前包含九个不同的项目。构建成功,没有任何错误消息。当我运行应用程序时,抛出TypeLaodException,无法加载 Type Namespace.AClassName

My Solution contains currently nine different projects. A build succeeds without any error messages. When I run the application, a TypeLaodException is thrown, The Type Namespace.AClassName could not be loaded.

奇怪的是,那里不再是任何名为 AClassName 的类。但是,提到的类确实存在于以前的版本中。

The weird thing is, that there isn't any class named AClassName anymore. BUT, the mentioned class did exist in a former version.

我清理了解决方案,开始构建,同样的错误。我重建了解决方案,同样的错误。

I cleaned the solution, startet a build, same error. I rebuilt the solution, same error. Cleaned than rebuilt the solution, same error.

显然,构建不正确。但是,我能做些什么来确保构建正确运行?

Apparently, the build is not correct. But what can I do to ensure, that the build runs correctly?

推荐答案

如果手动删除文件夹注释中建议的bin obj 不起作用,我还将删除de .vs ,您可以尝试以下操作:

If manually deleting the folders bin and obj as suggested in the comments is not working, I will also delete de .vs and there are a few things you can try:


  • 卸载项目,然后在 .csproj 以引用旧删除的 AClassName 中的
    。还要检查是否没有与此相关的名称空间。
    您将必须在原来是该类的项目中进行操作,但我建议在所有9个项目中进行搜索。

  • 检查配置中是否存在任何项目依赖项管理器与 AClassName 所在的项目有关。

  • 我还将重新启动计算机,删除临时文件夹并以管理员身份运行VS。

  • Unload the projects, and search in the .csproj for any reference to the Old-Deleted AClassName. Check also that there is no namespace related to it.
    You will have to do it in the project where originally was the class, but I will recommend to search in all 9 projects.
  • Check if there is any Project Dependency in the Configuration Manager related to the project where the AClassName was.
  • I would also restart my machine, delete temp folder and run VS As administrator.

这篇关于Visual Studio Build似乎不使用当前项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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