-2

I want to specify the NuGet package source in vs code since I got follow error :

enter image description here

Those packages from a customized NuGet source which is causing this issue.

Is there have any way can help me resolve this case?

Liam
  • 27,717
  • 28
  • 128
  • 190
JUstLearning
  • 5
  • 1
  • 3
  • 2
    Welcome to stack overflow.It is usually a good idea to copy/paste your error message into your question. A screenshot is more difficult to handle and will lower your chances of getting an answer. – Sefe Oct 31 '19 at 08:14
  • 1
    Welcome! It's better to include the actual error as _text_ rather than an image so that others will arrive here from the likes of _Google_. Oh poo @Sefe beat me by 28 secs ;) –  Oct 31 '19 at 08:15
  • 1
    Does this answer your question? [Add custom package source to Visual Studio Code](https://stackoverflow.com/questions/41358490/add-custom-package-source-to-visual-studio-code) – Liam Oct 31 '19 at 08:20

2 Answers2

3

I usually solve this by having a nuget.config file in the same place as your .csproj. Contents look like this

<?xml version="1.0" encoding="utf-8"?>
<configuration>
 <packageSources>
    <add key="ArtifactoryNuGetV3" value="https://{URL GOES HERE}/artifactory/api/nuget/v3/nuget-local" protocolVersion="3" />
 </packageSources>
</configuration>

Another way to do it is to provide --source in your commandline Documentation.

If yout are using visual studio, you probably would need to add that nuget source manually.

Grimson
  • 540
  • 1
  • 5
  • 21
  • 1
    Thanks for your help , i tried this workaround before but not work. – JUstLearning Oct 31 '19 at 08:32
  • If you can access the nuget source in Visual Studio, then you can do it in VSCode as well. You need to make sure the URL you put in value is correct. You can check if it is correct or not by using the option "Manage Nuget Packages" in Visual Studio, and adding your custom nuget source there. Additionally, you can also test if your URL is correct by using the commandline version – Grimson Oct 31 '19 at 08:47
-2

I solve it by add follow content in Dockerfile under the project. enter image description here

Arvind Maurya
  • 910
  • 12
  • 25
JUstLearning
  • 5
  • 1
  • 3