I'm having some troubles while creating some Unit Tests with .NET Core 2.1 + VS Code on Linux behind a corporate proxy. I'm fairly new to VS Code and .NET Core, although I have experience with .NET and Visual Studio.
I can successfully create a solution (dotnet new sln), Class Library (dotnet new classlib)/Console Application (dotnet new console) projects and properly link them together. However, when attempting to perform Unit Testing with:
dotnet new xunit,
the dotnet restore operation fails. The output of the aforementioned command is the following:
/usr/share/dotnet/sdk/2.1.301/NuGet.targets(114,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/home/ryuzakyl/Desktop/CSharpWithVSCode/test/CSharpWithVSCode.Tests/CSharpWithVSCode.Tests.csproj]
/usr/share/dotnet/sdk/2.1.301/NuGet.targets(114,5): error : Response status code does not indicate success: 407 (Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )). [/home/ryuzakyl/Desktop/CSharpWithVSCode/test/CSharpWithVSCode.Tests/CSharpWithVSCode.Tests.csproj]
The error messages suggest that this could be related to some proxy configuration issues (HTTP 407 error issued), but I'm perfectly able to install VS Code extensions for C# (C#, Nuget Package Manager, Omnisharp, etc.) behind the corporate proxy.
I think the error might be related to the NuGet proxy configuration. I followed these instructions (on Linux the file I used was ~/.nuget/NuGet/NuGet.Config), but none of the recommendations worked for me.
In case it helps:
$ uname --all
Linux matrix 4.8.0-53-generic #56~16.04.1-Ubuntu SMP Tue May 16 01:18:56 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ dotnet --version
2.1.301
$ code --version
1.30.1
dea8705087adb1b5e5ae1d9123278e178656186a
x64
Thanks in advance ;).