Dmitri
Dmitri

Reputation: 2972

Visual Studio does not recognize a referenced assembly?

Opened an old project from years ago. Build fails because Visual Studio (2019) does not recognize an assembly that is clearly there - specifically, Autofac.

  1. You can see it in project references (not marked as missing) Project References

  2. You can see it in the Object Browser, listing all the types referenced in the code

In Object Browser

  1. But in code, none of the types show up, gone AWOL.

In code

What is going on here? Intellisense doesn't even pick up types (Tried cleaning, rebuilding, re-importing packages)

Upvotes: 1

Views: 1464

Answers (1)

Dmitri
Dmitri

Reputation: 2972

Okay, this is what worked. I had to remove the reference to the Autofac dll, and then add it back. Note - I added it back from the same exact location, the same exact version. But after this, Visual Studio 'magically' recognized it. If you come across a similar problem, and nothing else works, give it a try. I don't know the reason, I can only assume this is some sort of a bug in Visual Studio.

Upvotes: 1

Related Questions