0

I am working on a C# program that utilizes EntityFramework, I've cloned the program from git repo, but now it is having that dreadful Metadata file 'EntityFramework.dll' could not be found error. I have searched and tried countless suggestions for this kind of problem, but none worked. I've already checked that the reference to EntityFramework.dll in the .csproj files are correct and it is definitely there under the packages\EntityFramework.6.2.0\lib\net45\ folder. So I am not sure what else to try.

For Comment
  • 1,139
  • 4
  • 13
  • 25

4 Answers4

1

Ok, I've resolved this problem. Here is what happened. Apparently, when cloning into local directory, one of the folder on the path has a space in its name (like My DSS), and this nuget issue seems to indicate the inability of nuget to find package with space in path. So, once I changed that folder's name to MyDSS, it compiled successfully.

For Comment
  • 1,139
  • 4
  • 13
  • 25
0

please have a look on the bin folder ,sometimes the dlls do not exist there .

  • 1
    well, the error is preventing the compilation to finish, so of course the DLL is not going to be in the bin folder, plus, the issue is why the compilation is not finding that DLL in the first place. – For Comment Mar 26 '19 at 20:44
  • have you tried to run Visual Studio as administrator , remove obj folder , Rebuild the entire solution ? – Mahmoud-Abdelslam Mar 26 '19 at 21:10
0

In Visual Studio, on top, click on Build -> Configuration Manager. Make sure that the build checkbox next to your project is checked. In case it already is, uncheck it and then make it checked again. Clean your Solution and Build it again after this.

E_net4
  • 27,810
  • 13
  • 101
  • 139
Hassnain Ali
  • 222
  • 3
  • 12
0

This typically happens when teams check in files that should not be checked in (such as the .suo file) or have "optimized" their builds to exclude rarely changed projects. (unticking projects in the configuration manager.)

Another common cause for missing references is when devs reference a dependency from a /bin folder instead of the packages folder, but it sounds like you've confirmed that isn't the case.

Other questions such as Metadata file '.dll' could not be found list a number of things to check, so your problem will surely be one of these. Try building each project individually, working from projects that have no project dependencies upwards to the main application project(s). Ensure they're running the same .Net versions, check the solution NuGet packages for dependencies with "multiple versions" and consolidate these so that the solution is using a single version of each dependency. (generally good for cleaning up) Also look at .config files for version re-directs that sometimes get zombified in source control.

Steve Py
  • 26,149
  • 3
  • 25
  • 43