在Visual Studio 2017中``找不到类型或名称空间'' [英] 'the type or namespace could not be found' in Visual Studio 2017
问题描述
每次我从远程执行git pull更新我的分支时,Visual Studio 2017在打开文件时都会在许多文件中显示找不到类型或名称空间"错误.有趣的是,对于相同的项目/存储库,我在Visual Studio 2015中看不到该问题.该软件在两个版本的Visual Studio中都可以正常运行,因此是错误的.进行清理或重建不能解决问题.我最终从远程重新克隆了存储库,然后Visual Studio 2017感到高兴.有人知道如何解决这个烦人的问题吗?
Every time I do a git pull from remote to update my branch, Visual Studio 2017 shows "the type or namespace could not be found" error in many files as I open them. Interestingly I don't see the problem in Visual Studio 2015 for the same projects/repo. The software builds fine in both versions of Visual Studio so it is a false error. Doing a Clean or Rebuild doesn't fix the problem. I end up re-cloning the repo from remote and then Visual Studio 2017 is happy. Any one knows how to fix this annoying problem?
推荐答案
问题是软件包还原.如果失败,则会出现问题. 您可以尝试卸载和重新加载项目,但是我仍然没有找到避免这种情况的方法.
The problem is the package-restore. If it fails, you get the issue. You can try to unload and reload the projects, but I also still haven't found a way to avoid it.
这篇关于在Visual Studio 2017中``找不到类型或名称空间''的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!