简体   繁体   中英

Visual Studio 2017 references to code in other projects not resolved when i open the solution

I have a solution in Visual Studio 2017 where projects reference other projects in the solution; when I open the solution and I open a project the references to code defined in other projects seems not resolved (is like the other projects had not yet been loaded) I must click every single projects, expand it and then the reference are all resolved. Is there a work around to avoid this?

UPDATE : I have Lightweight Solution enabled for the single solution
and Resharper installed.

To be clear the solution builds but visual studio show me in red references to code in other projects and i get errors in the error windows even if the building succeed

UPDATE 2 As suggested by Pankaj Kapare if I disable the Lightweight modality for the solution the problem disappear but still persist if I enable Lightweight again

在此输入图像描述

在此输入图像描述

You may have turned "Lightweight Solution load" option on. You can disable it using following steps:

  1. Go to Tools > Option > Projects and Solutions > General settings page.
  2. Uncheck "Lighweight solution load for all solutions" if its checked.
  3. Reopen Visual Studio.

For those who (like me) applied the solution by @Pankaj Kapare and still had the same problem:

  1. Go to Tools > Options > Projects and Solutions > General
    • Notice the message May be overridden for individual solutions
  2. Make sure Always show solution is ticked
    • click OK
  3. Open Solution Explorer with Ctrl + Alt + L
    • click the solution
    • hit F4 to open Properties
  4. Make sure Lightweight load is set to Disabled or Default

我通过删除csproj.user文件解决了这个问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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