Home > Software design >  Visual Studio Intellisense Can Find References But Build Fails Due To Missing References
Visual Studio Intellisense Can Find References But Build Fails Due To Missing References

Time:07-06

I'm currently running into an issue (on Visual Studio 2022) where the test project within my solution is referencing a few other projects in my solution; however, trying to build the test project results in errors for these project references. Even more interesting is that this test project used to be working fine.

So far I've:

  • Double checked the pathing of the project dll's being referenced
  • Removed and re-added the project references.
  • Editing the file, Intellisense is able to find the references, but when building the console output shows errors.
  • Cleaned the solution
  • Seen recommendations online of clearing the Temp folder and AppData\Local\Microsoft\VisualStudio\17.x\ComponentModelCache for my user account and have done so

None of this has helped. Any guidance on what to research or things to try/insight to the problem would be much appreciated!

Thank you

-Austin

EDIT 1 (7/5/2022) Error List Image

The error seem to resolve themselves when I click on them from the Error Lists (after viewing the place in the file where the reference error is occurring, the error disappears after a few seconds, removing it from the Error List and also the removing the red squiggle underline). However, the error does not actually resolve as there are still the same reference errors when trying to Build the test project.

For example, STEP.Entities is a project in the solution that is referenced by the test project. However, the test project can't find the referred Entities project.

CodePudding user response:

I've had this problem recently with a project from GitHub, my best sugestion is to try checking the version you are using and maybe select an older version of the said references. It took me a while to get it done but it worked.

CodePudding user response:

I think I worked around this with following global.json in the root of my drive:

C:\global.json

{
  "sdk": {
    "version": "6.0.300",
    "rollForward": "latestFeature",
    "allowPrerelease": false
  }
}
  • Related