【发布时间】:2016-01-31 19:33:32
【问题描述】:
我目前在 Visual Studio 工作,开发基于文本的游戏。我与某个类发生了命名空间冲突。
我有一个类名 Clothing 和命名空间,它也命名为 Clothing。为了解决这个问题,我重命名了命名空间 clothes 而不是服装,然后所有的戏剧都开始了。每当我尝试构建时,我的 csproj 文件都没有更新文件夹中的命名空间引用,我收到以下错误。
[Failure] Could not find file '...\src\Items\Equipment\Apparel\Clothing\Shirts\Shirt.cs'.
[Failure] Could not find file '...\src\Items\Equipment\Apparel\Clothing\ClothingEnum.cs'.
[Failure] Could not find file '...\src\Items\Equipment\Apparel\Clothing\Cloaks\Cloak.cs'.
[Failure] Could not find file '...\src\Items\Equipment\Apparel\Clothing\Boots\JackBoot.cs'.
...
如果我查看这些目录,文件存在但为空。实际文件位于 ...\src\Items\Equipment\Apparel\ Clothes\Boots... 中,它们包含在 csproj 文件中。但是这些文件也在那里。
本质上,我要问的是如何从 csproj 文件中删除这些未使用的引用/依赖项/无论它们是什么。
手动删除 csproj 文件中的 xml 引用只会导致我的项目加载失败。
【问题讨论】:
标签: c# visual-studio visual-studio-2015 build-error