Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Search disk C: or D: in Nuget.Config

I have a following Nuget.Config file in which I specify path to nuget packages:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <packageSources>
        <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
        <add key="SomeKey" value="D:\...\somePath" />
    </packageSources>
</configuration>

However this configuration targets disk D: directly and I would like to target disk C: or disk D:. Or if it does not find such on disk C: it would search for it on disk D:. I could not find such solution in documentation and truth be told I have never stumbled upon such solution in any path configuration in any language or framework. But it would be quite handy one. Thank you in advance

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You could simply add two package sources, one for each drive:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <packageSources>
        <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
        <add key="SomeKey" value="D:\...\somePath" />
        <add key="SomeOtherKey" value="C:\...\somePath" />
    </packageSources>
</configuration>

Then in the NuGet package manager, you can either choose to search "All" (i.e. NuGet, SomeKey, and SomeOtherKey), or choose a specific one to search:

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading