ʃʈɑɲ
ʃʈɑɲ

Reputation: 2684

Shared nuget.config file on TFS

I have this setup:

$/Shared/nuget.config
$/Shared/.nuget
$/SomeTeamProject/nuget.config
$/SomeTeamProject/SomeTeamProject.sln

Using VS.Net 2015 Update 3

nuget.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>  
  <config>
    <add key="repositoryPath" value="$\..\..\Shared\.nuget" />
  </config>
  <packageRestore>
    <add key="enabled" value="true" />
    <add key="automatic" value="true"/>
  </packageRestore>
</configuration>

I'd like to refer to the nuget.config file from Shared.
(I tried adding nuget.config to $/ but that's not allowed by TFS)
Added $/Shared/nuget.config as an existing item to SomeTeamProject
but it doesn't seem to work..
It only works when I copy nuget.config from Shared to the SomeTeamProject folder.

It seems to ignore the referenced nuget.config file and creates a .packages folder in the SomeTeamProject folder..

A hard copy of nuget.config from the Shared Team Project works ok.

Hard Copy

But a linked (add existing file) is not being used by NuGet for this solution:

Link

Solution files

Shared Team Project files

Upvotes: 0

Views: 577

Answers (1)

Eddie Chen - MSFT
Eddie Chen - MSFT

Reputation: 29958

The nuget.config file isn't used when you place it in "Shared" folder. You can refer to Configuring NuGet Behavior and specially Priority ordering section to see how the nuget.config file works.

And there is no way to simply add a link to get it work. The nuget only check the files in current folder or up level folder, it does not check the linked nuget.config file.

Upvotes: 1

Related Questions