Reputation: 17568
This issue is regarding the continuous integration feature in visual studio team services, specifically in automated builds.
I've set up a build definition to build my .net core mvc application.
It is using .NET core v1 and compiling against .net framework 4.5.2.
I've followed the instructions here:
https://www.visualstudio.com/en-us/docs/build/apps/aspnet/ci/build-aspnet-core
I have a private NuGet feed set up in VSTS Here is the command that adds the package feed source:
Sources Add -Name "CiiDLFeed" -UserName "<username>" -Password "<password>" -ConfigFile $(Build.SourcesDirectory)/Nuget.config -Source https://mycompany.pkgs.visualstudio.com/_packaging/DLFeed/nuget/v3/index.json
The error I'm receiving:
error: Unable to load the service index for source https://mycompany.pkgs.visualstudio.com/_packaging/DLFeed/nuget/v3/index.json. error: Password decryption is not supported on .NET Core for this platform. The following feed uses an encrypted password: 'CiiDLFeed'. You can use a clear text password as a workaround.
In response to this, I added "-StorePasswordInClearText" parameter to the NuGet source add command:
Sources Add -Name "CiiDLFeed" -UserName "<username>" -Password "<password>" -ConfigFile $(Build.SourcesDirectory)/Nuget.config -Source https://mycompany.pkgs.visualstudio.com/_packaging/DLFeed/nuget/v3/index.json -StorePasswordInClearText
Now, I get a 401 error:
error: Unable to load the service index for source https://mycompany.pkgs.visualstudio.com/_packaging/DLFeed/nuget/v3/index.json. error: Response status code does not indicate success: 401 (Unauthorized).
I'm using the same exact credentials that work correctly in a separate build definition, accessing the same nuget feed (a .NET web forms app), so it should not be giving me a 401.
I've also tried simply referencing the library dll's instead of NuGet packages in a private feed, but that appears to be not possible with .NET Core:
.NET core projects only support referencing .NET framework assemblies in this release. To reference other assemblies, they need to be included in a NuGet package and reference that package.
Upvotes: 3
Views: 3362
Reputation: 33728
You need to your own Nuget.Config file instead (Can use PAT as password):
arguments like:
--configfile $(build.sourcesdirectory)/ConsoleAppCore/Nuget.Config
Note: You can create or edit a NuGet.config at the solution root, next to the project.json file and check into source control, with this way, you don't need to specify configfile argument for .Net Core restore step.
Upvotes: -1
Reputation: 17568
The workaround solution we used is to setup a local NuGet source that is a directory in the project. Then add your .nupkg files to it, and reference them in your project.
This allows the VSTS CI build to access your NuGet package without setting up a remote NuGet source.
eg:
project_directory/
... project files ...
my_nuget_repo/
mypackage.nupkg
Add the local source:
nuget sources add -Name "my_nuget_repo" -Source "<path_to_project>/my_nuget_repo"
Upvotes: 2