C:WindowsMicrosoft.NETFramework64v4.0.30319Microsoft.Common.targets (1605): Could not resolve this reference. Could not locate the assembly “EntityFramework”. Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

Project build fine on local machine, but fails on TFS with error: C:WindowsMicrosoft.NETFramework64v4.0.30319Microsoft.Common.targets (1605): Could not resolve this reference. Could not locate the assembly “EntityFramework”. Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

It took me some time to solve, but the solution is simple: Add the package folder to sourcecontrol

◾go to source control explorer
◾open your solution
◾right click Packages folder
◾click ‘Add items to folder’
◾select all files
◾click next
◾click excluded items
◾select all files
◾click include items
◾click finish

 

5 thoughts on “C:WindowsMicrosoft.NETFramework64v4.0.30319Microsoft.Common.targets (1605): Could not resolve this reference. Could not locate the assembly “EntityFramework”. Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

  1. Had this same error bugging me for the past couple of days. Your solution sent me in the right direction. My package folder was already in source code but for some reason all the files were not included.

    Thanks

    • You don’t need to move or change the DLL’s. Just take these steps:
      ◾go to source control explorer
      ◾open your solution
      ◾right click Packages folder
      ◾click ‘Add items to folder’
      ◾select all files
      ◾click next
      ◾click excluded items
      ◾select all files
      ◾click include items
      ◾click finish

      • Thanks for providing the steps..I m not able to see packages folder in my solution .

        I created new packages folder and added Sitecore.Client.dll,Sitecore.Kernel.dll to that.

        I am getting below error after the build

        C:WindowsMicrosoft.NETFramework64v4.0.30319Microsoft.Common.targets (1605): Could not resolve this reference. Could not locate the assembly “Sitecore.Client”. Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors

  2. There should be a packages folder that has been created automatically by NuGet package manager.
    What you could try:
    1) reinstall the packages using NuGet
    2) check the file location of the references that have been added by NuGet. That should be the packages folder.
    3) Be sure to automatically download packages (tools -> options -> package manager -> general check the all boxes)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>