将项目从VS2015升级到VS2017后,TFS绑定无效 [英] TFS Binding Invalid After Upgrading Project From VS2015 to VS2017

查看:63
本文介绍了将项目从VS2015升级到VS2017后,TFS绑定无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VS 2015中开始研究.Net Core解决方案,其中包含一个ASP.Net Core项目和几个.Net Core类库.该解决方案受TFS源代码控制.

I began working on an .Net Core solution in VS 2015, which contains an ASP.Net Core project and a couple of .Net Core class libraries. The solution was under TFS source control.

我想包含一些单元测试.由于VS 2015不包含.Net Core单元测试项目模板,因此我决定安装VS 2017并升级解决方案.升级后,我能够添加一个单元测试项目,并且所有内容都能编译并正常运行.

I wanted to include some unit tests. Since .Net Core unit test project templates are not included with VS 2015, I decided to install VS 2017 and upgrade the solution. After upgrading, I was able to add a unit test project and everything compiles and runs normally.

但是,当我在升级后首次打开解决方案时,最初会收到关于该解决方案被视为不受源代码控制的错误.基于Google搜索,我进入文件->源代码管理->高级->更改源代码管理,然后在每个项目上单击绑定".三个旧项目直接链接并显示为有效",而解决方案文件和新单元测试项目显示为无效".取消绑定,卸载,重新加载和重新绑定无效的项目无济于事.我可以强制项目绑定,即使它是无效的(针对Visual Studio的警告),经过一番修补后,我可以找到要检查的解决方案,但是当我在另一台计算机上获得最新版本时,三个原始项目会说不可用".",则单元测试项目不可见.

When I first opened the solution after upgrading, though, I initially got an error about the solution being treated as though it was not under source control. Based on Google searches, I went into File -> Source Control -> Advanced -> Change Source Control and clicked "Bind" on each project. The three old projects link right up and show up as "Valid", while the solution file and the new unit test project show up as "Invalid". Unbinding, unloading, reloading, and rebinding the invalid project did not help. I can force the project to bind even though it is invalid (against Visual Studio's warnings), and after some tinkering, I can get the solution to check in, but when I get latest on another machine, the three original projects say "Not Available" and the unit test project is not visible.

其他症状:尝试登录时找不到project.json(我必须撤消"或排除"才能签入解决方案),无论我尝试什么,都会显示无效的单元测试项目文件夹有效目录位于目录树的根文件夹中(与"src"和"Backup"处于同一级别),而有效项目位于"src"目录中.我推断这是因为新的解决方案类型允许一个.xproj文件,而旧的解决方案则需要project.json,但是我不知道该怎么做...

Other symptoms: project.json is not found when I try to check in (I have to "undo" or "exclude" to check the solution in) and regardless of what I try, the invalid unit test project's folder shows up in the root folder of the directory tree (at the same level as "src" and "Backup") while the valid projects are in the "src" directory. I am inferring this is because the new solution types allow an .xproj file, while the old solutions required project.json, but I don't know what to do about it...

任何有关如何将其重新链接到源代码控制的想法将不胜感激!升级VS时,我没有升级TFS服务器,但是我没有直接访问它的权限,因此希望这不是必需的...

Any ideas on how to relink this to source control would be appreciated! I did not upgrade TFS server when I upgraded VS, but I don't directly have access to it, so hopefully this is not a requirement...

推荐答案

要修复VS中的无效绑定,您可以尝试执行以下步骤:

To fix the invalid binding in VS, you could try to follow below steps:

  1. 在解决方案资源管理器中单击无效"项目.
  2. 打开"文件|源代码管理|更改源代码控制"
  3. 取消绑定无效的项目.
  4. 在解决方案资源管理器中,卸载项目.
  5. 在解决方案资源管理器中,重新加载项目.

Also clear TFS and VS cache, delete the old workspace, create a new one, get all projects you need from TFS source control. Everything should be back on track.

这篇关于将项目从VS2015升级到VS2017后,TFS绑定无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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