Search code examples
c#visual-studiodependenciesclass-libraryproject-reference

Could not load file or assembly for project reference


I have two class library projects and one Web API project. Let it be ClassLibrary1, ClassLibrary2, WebApi.
I add link for Web API to both ClassLibrary1 and ClassLibrary2 as a project reference.
In addition, ClassLibrary1 has link to ClassLibrary2 as a project reference.

At the compilation stage, I have no errors, But in runtime, I got the next error:
Could not load file or assembly 'ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

All Nuget packages have the same versions for these projects.

enter image description here


Solution

  • The problem was resolved when I removed the solution from my local storage and reloaded it from the repository.