Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
436 views
in Technique[技术] by (71.8m points)

caching - Visual Studio retrieving an incorrect path to a project from somewhere

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 ProjectsExampleSolutionExampleProjectWrongExampleProjectCorrect.csproj

whereas actually, the project file is located here:

C:My ProjectsExampleSolutionExampleProjectCorrectExampleProjectCorrect.csproj

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

  • Removing and re-adding the project from the correct location. An error message comes up saying The project file at C:My ProjectsExampleSolutionExampleProjectWrongExampleProjectCorrect.csproj could not be found.

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

  • 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.

  • Deleting the cache directories for VS and TFS

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
  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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...