Where does Visual Studio is referring the actual NuGet referenced DLL?

You use the new Package Reference where the NuGet files get get stored into a cache:

Solution-local packages folders are no longer used – Packages are now resolved against the user’s cache at %userdata%\.nuget, rather than a solution specific packages folder. This makes PackageReference perform faster and consume less disk space by using a shared folder of packages on your workstation.


As @magicandre1981 already explained, with PackageReference style package referencing (as apposed to package.config-style, also see this for more background on the differences, in case you didn't know), the packages are not located in a per-solution packages-folder, but in a central one (by default %USERPROFILE%\.nuget\packages). Albeit you can easily change the location using the NUGET_PACKAGES environment variable (which also works as a TFS Build variable, because they are provided as environment variables to build steps).

Furthermore, inside Visual Studio you see no path, because the actual path to the DLL is determined at build time. You can see part of that path in your <project-dir>\obj\project.assets.json file (which is generated during the restore target/operation), but the full path you will only see in the MSBuild logs (for example when actually calling the csc.exe executable/C# compiler or during ResolveAssembyReferences-task).

Note that for .NET Core, i.e. "SDK style" projects, the path is actually shown in properties (as are the actual DLLs in a node underneath the "package" node.

PackageReference in SDK-style projects

One can only assume that the integration of PackageReference in "old" projects is not fully done yet (if ever).

For comparison a PackageReference in an "old" / non-SDK-style project:

PackageReference in non-SDK-style/old project


Assume you are using TFS 2015, the NuGet Restore task name should be NuGet Installer which under Package when you add tasks.

So, if you have installed Nuget in the build machine, then you can use the task directly. You can also custom nuget.exe for TFS 2015 build -- Just specify the Path to NuGet.exe

You can refer to Mummy's blog- Custom nuget.exe for TFS 2015 build for details.

enter image description here