简体   繁体   English

VS intellisense 无法处理多个项目的解决方案

[英]VS intellisense not working on solution with multiple projects

I am working on a .NET Core/C# solution that contains multiple projects.我正在研究包含多个项目的 .NET Core/C# 解决方案。 I have done so before but for this one I set up everything through a remote server in a linux terminal.我之前已经这样做了,但对于这个我通过 linux 终端中的远程服务器设置了所有内容。 Once all my projects were created and pushed to GitHub, I pulled to my local machine.创建完所有项目并将其推送到 GitHub 后,我将其拉到本地计算机。 Problem I am running into is that intellisense is not working at all in any project in my solution.我遇到的问题是智能感知在我的解决方案中的任何项目中都不起作用。 I am wondering if I set up everything correctly or if there is something I am missing.我想知道我是否正确设置了所有内容,或者是否缺少某些内容。 Below is some screenshots of my directory and one screenshot of VS.下面是我的目录的一些截图和VS的一个截图。

root dir from repo来自 repo 的根目录来自 repo 的根目录

1 dir down into BlabberApp folder 1 dir 进入 BlabberApp 文件夹1 dir 进入 BlabberApp 文件夹

2nd dir down into BlabberApp.DomainTest第二个目录进入 BlabberApp.DomainTest 第二个目录进入 BlabberApp.DomainTest

What is shown in VS when I open root dir打开根目录时 VS 中显示的内容打开根目录时 VS 中显示的内容

What is shown in VS when I open solution file打开解决方案文件时 VS 中显示的内容打开解决方案文件时 VS 中显示的内容

I have tried opening using open file for: .csproj file, .cs file, as well as open folder for various folders that hold my separate projects.我尝试使用打开文件打开:.csproj 文件、.cs 文件,以及用于保存我的单独项目的各种文件夹的打开文件夹。 I also tried to open folder to the BlabberApp folder which contains the folders that hold my.sln as well as the folders that hold all my separate projects.我还尝试打开文件夹到 BlabberApp 文件夹,其中包含保存 my.sln 的文件夹以及保存我所有单独项目的文件夹。 I need intellisense to recognize references some projects have with each other.我需要智能感知来识别一些项目之间的引用。 I also need it to recognize my tests to properly test everything.我还需要它来识别我的测试以正确测试所有内容。 One thing peculiar I found is when I open the.sln file it shows in the solution explorer that 0 projects are loaded.我发现的一件事是当我打开 .sln 文件时,它在解决方案资源管理器中显示加载了 0 个项目。 Also none of my tests are recognized in the test explorer (I have tried cleaning and building the sln with no changes showing in test explorer).我的测试也没有在测试资源管理器中被识别(我已经尝试清理和构建 sln,但测试资源管理器中没有显示任何更改)。

I have also gone through the steps of going to tools -> options -> text editor -> c# -> intellisense to check/uncheck the boxes under completion lists.我还完成了前往工具 -> 选项 -> 文本编辑器 -> c# -> intellisense 的步骤,以选中/取消选中完成列表下的框。 Any advice would be helpful!任何意见将是有益的! Thanks谢谢

It seems any of your projects are not listed in your solution.您的解决方案中似乎没有列出您的任何项目。 Somehow they unloaded from the solution.不知何故,他们从解决方案中卸载了。 You can add the projects one by one in the solution.您可以在解决方案中一一添加项目。 Or you can take help of a plugin that will add all projects from the solution folder at once.或者,您可以借助一个插件来一次添加解决方案文件夹中的所有项目。 please add them by the following step:请按以下步骤添加它们:

  1. Add this VS extension添加这个VS 扩展
  2. Right-click on the solution and click on Add multiple projects右键单击解决方案,然后单击添加多个项目
  3. check Add solution folder检查添加解决方案文件夹
  4. Click Load Projects From Folder单击从文件夹加载项目
  5. Select the solution directory Select 解决方案目录
  6. Select all projects Select 所有项目
  7. Click start点击开始

please follow the link instructions for more details.请按照链接说明了解更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM