Visual Studio从某处检索到项目的错误路径 [英] Visual Studio retrieving an incorrect path to a project from somewhere

查看:140
本文介绍了Visual Studio从某处检索到项目的错误路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Visual Studio(可能还有TFS)在某种程度上(我认为也许在源代码控制合并期间)对解决方案中的项目路径感到困惑.

Visual Studio (and possibly TFS) has somehow (I think perhaps during a source control merge) become confused about the path of a project within my solution.

它认为就在这里(为简单起见,示例路径):

It thinks it is here (example paths for simplicity):

C:\My Projects\ExampleSolution\ExampleProjectWrong\ExampleProjectCorrect.csproj

实际上,项目文件位于此处:

whereas actually, the project file is located here:

C:\My Projects\ExampleSolution\ExampleProjectCorrect\ExampleProjectCorrect.csproj

我一生都无法识别正确的位置.我已经尝试过:

I cannot for the life of me get it to recognize the correct location. I have tried:

  • 从正确的位置删除并重新添加项目.出现错误消息,提示The project file at C:\My Projects\ExampleSolution\ExampleProjectWrong\ExampleProjectCorrect.csproj could not be found.

手动编辑.sln文件,以确保所有对ExampleProjectCorrect.csproj的引用都具有正确的路径.

Manually editing the .sln file to ensure all references to ExampleProjectCorrect.csproj have the correct paths.

在解决方案目录中的文件中查找正确和错误的路径,以尝试跟踪Studio隐藏错误路径的位置.

Doing a find in files on the solution directory for both the correct and incorrect paths, to try and track down where studio is hiding the incorrect path.

删除VS和TFS的缓存目录

Deleting the cache directories for VS and TFS

我要拔头发是因为我无法重新创建该解决方案,因为该解决方案几乎没有影响100个项目,并且与其他几位开发人员一起致力于源代码控制.

I'm tearing my hair out because I can't recreate the solution as it has near as makes no difference 100 projects in and is tied in to source control with several other developers working on it.

任何人都可以向我指出该错误路径的存储位置和/或如何对其进行重置,以便该死的东西能够正确加载的正确方向吗?

Can anyone point me in the right direction as to where it is storing this incorrect path and/or how to reset it so the damn thing will load correctly?

推荐答案

  1. 转到管理工作区(通过文件/源代码控制"菜单或源代码管理资源管理器"中的工作区下拉菜单)
  2. 为您的工作区选择 edit .
  3. 您应该在工作文件夹下看到源的映射 控制目录到旧/错误的项目目录.
  4. 选择它,然后单击删除.
  5. 关闭VS并删除suo文件.
  1. Go to Manage Workspaces (either through the File/Source Control menu or the workspace drop down in Source Control Explorer)
  2. select edit for your workspace.
  3. You should see, under working folders, a mapping for the source control directory to the old/wrong project directory.
  4. Select it and click remove.
  5. Close VS and delete the suo file.

它仍然引用错误的目录.也许重新绑定可能在这一点上可行,但我没有尝试过.重新加载您的项目,您应该一切顺利.

It still references the wrong directory. Maybe rebinding might work at this point but I didn't try that. Reload your project and you should be good to go.

这篇关于Visual Studio从某处检索到项目的错误路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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