0

I have a asp.net 5 (vNext) project with a project.json that is named FMS.DOMAIN. One of the references is a dotNet 4.51 project named FMS.DAL.

This works on all machine except one. On one machine it can't find this dotNet 4.51 project. I think it is looking for it on a public nuget server.

When I do 'dnu restore' I see this:

C:_Workspaces\MyProject\MyProject\FMS.Domain\project.json CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='FMS.DAL' Unable to locate Dependency FMS.DAL >= 1.0.

This is the project.json from FMS.Domain.

{
  "version": "1.0.0-*",
  "description": "FMS.Domain Class Library",
  "authors": [ "ctcrrmcidmc" ],
  "tags": [ "" ],
  "projectUrl": "",
  "licenseUrl": "",
  "frameworks": {
    "dnx451": {
      "dependencies": {
        "FMS.DAL": "1.0.0-*"
      }
    }
  },
  "dependencies": {
    "AutoMapper": "4.1.1",
    "FMS.Common": "1.0.0-*"
  }
}

How does it know when to search nugget and when to use a local project? The reference to "FMS.Common": "1.0.0-*" is also a local project and it's working (but it's vNext).

We did get it to work if we had a reference to the DLL directly using the 'Add Reference' context menu. That produce an edit the project.json that look the same as the manual edit but it works. It must be doing something else.

More Info: I blew away my workspace and got the code fresh from TFS. I am getting the problem on my machine. I see this error with 'dnu restore':

CACHE https://www.nuget.org/api/v2/FindPackagesById()?id='FMS.DAL' nable to locate Dependency FMS.DAL >= 1.0.0

It is looking for FMS.DAL at nuget.org instead of in my project. I removed the dependency from project.json and saved, then I add it back by right-clicking on references and picking a project reference. It's added back to project.json and looks exactly the same as before I removed it. I run 'dnu restore' again and it works.
The only pending change is in project.json and when I do a compare with TFS there are no differences. Then I did an undo pending changes for the entire solution and 'dnu restore' still works.

Don Chambers
  • 3,798
  • 9
  • 33
  • 74
  • It appears that somehow the dll for FMS.DAL project is missing on that machine, so the dependency resolution is trying to resolve this using NuGet. – Vivek N Feb 18 '16 at 03:44
  • The dependency resolution system looks in the available nuget feeds unless it finds the project the current project's parent folder or the folders listed in `global.json` – Victor Hurdugaci Feb 18 '16 at 04:46
  • If the FMS.DAL in the same solution, just try to remove the version number and write "FMS.DAL": "". This works for me in all cases. – Juergen Gutsch Feb 18 '16 at 13:07
  • The FMS.DAL project is in the solution and the dll file is created when I build. I have also removed the version number and it didn't work. As mentioned, this works on multiple machines - it's only one that does not work. I have had it happen on my machine, but I just remove the dependency and add it back (with the add reference context menu) and it works. – Don Chambers Feb 18 '16 at 14:33

0 Answers0