Azure devops (TFS) on prem download .net core SKD fails with self signed certificate in certificate chain - azure-devops

I am using azure devops on prem (previously called TFS). And I have a problem with build agent. When the agent is trying to download the latest microsoft .net core SDK it fails with self signed certificate in certificate chain error.
Here is the full error:
Starting: Use version 6.0.x of nuget
==============================================================================
Task : Use .NET Core
Description : Acquires a specific version of the .NET Core SDK from the internet or the local cache and adds it to the PATH. Use this task to change the version of .NET Core used in subsequent tasks. Additionally provides proxy support.
Version : 2.184.0
Author : Microsoft Corporation
Help : https://aka.ms/AA4xgy0
==============================================================================
Tool to install: .NET Core sdk version 6.0.x.
Found version 6.0.401 in channel 6.0 for user specified version spec: 6.0.x
Version 6.0.401 was not found in cache.
Getting URL to download .NET Core sdk version: 6.0.401.
Detecting OS platform to find correct download package for the OS.
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& 'C:\AzureDevops\agent\_work\_tasks\UseDotNet_b0ce7256-7898-45d3-9cb5-176b752bfea6\2.184.0\externals\get-os-platform.ps1'"
Primary:win-x64
Detected platform (Primary): win-x64
Downloading: https://download.visualstudio.microsoft.com/download/pr/aa0b6cf3-c5dc-40ff-8b2f-f2970ca7b9e3/5b4a9999ea41ca5897e01a3e0e1accad/dotnet-sdk-6.0.401-win-x64.zip
##[error]Failed while installing version: 6.0.401 at path: C:\AzureDevops\agent\_work\_tool/dotnet with error: Could not download installation package from this URL: https://download.visualstudio.microsoft.com/download/pr/aa0b6cf3-c5dc-40ff-8b2f-f2970ca7b9e3/5b4a9999ea41ca5897e01a3e0e1accad/dotnet-sdk-6.0.401-win-x64.zip Error: Error: self signed certificate in certificate chain
Finishing: Use version 6.0.x of nuget
I had a look on agent code on github and I think problem is in this method:
I coudn't dig deeper in the projec itself but I think it is using this azure-pipelines-tool-lib/tool
But I coudn't find anything that would help me there either.
Any suggestions or configurations to check?
My workaround so far is to download the sdk manually and place it into cache folder (agent_work_tool\dotnet\sdk) of the agent, but I would have to do that every time microsoft releases new major version.

Related

Azure DevOps Pipelene doesn't compile .netstandard 2.0 projects

I'm stuck in a rut with this proble. After converting some solution projects in .netstandard 2.0 the pipeline doesn't compile. Other are .NET Framework 4.8 projects.
Here the errors
Installed SDKs: No .NET SDKs were found.
Install the [6.0.400] .NET SDK or update
[E:\myApplicationFolder\global.json] to match an installed SDK.
Download a .NET SDK: https://aka.ms/dotnet-download
I tried the following steps:
installed VS 2022 and tells to the pipeline to use VS 2022 msbuild
installed the .NET sdk
created the global.json choerent with the solution
checked the environment variables (they point to C:\Program Files\dotnet)
checked the version of .NET SDK
This is the global.json
{
"sdk": {
"version": "6.0.400"
}
}
There are the configuration on the pipeline
I don't have any troubles building the solution with msbuild from powershell.
Any other suggestions? Thanks
Many problems, Azure DevOps isn't updated to the latest version and can't manage .NET 6.0 solutions. I had to specify the msbuild of VS 2022 also to restore nuget packages

Failed to download or parse release-index.json with error:

My Azure Devops build has started failing with the following message in the log
Starting: Use .NET Core sdk
==============================================================================
Task : Use .NET Core
Description : Acquires a specific version of the .NET Core SDK from the internet or the local cache and adds it to the PATH. Use this task to change the version of .NET Core used in subsequent tasks. Additionally provides proxy support.
Version : 2.165.0
Author : Microsoft Corporation
Help : https://aka.ms/AA4xgy0
==============================================================================
Tool to install: .NET Core sdk version 3.x.
##[error]Failed to download or parse release-index.json with error: {}
Finishing: Use .NET Core sdk
The YAML contains
steps:
- task: UseDotNet#2
displayName: 'Use .NET Core sdk'
inputs:
packageType: 'sdk'
version: 3.x
the image is windows-2019
I ran the pipeline again some time later and it worked.
I had enabled diagnostics. Not sure if that helped.

How can i create a manual VSTS release to NuGet?

Possible related, but seems outdated: VSTS Release Task - Push to Nuget
I have a open-source project on GitHub, which is setup to do a build on VSTS.
Now, i would like to have a VSTS Release definition, which publishes my package to NuGet. I would like to do this manually..so don't want it part of my VSTS build.
Can someone point me to the best resource on how to do this?
Here's my Release Definition:
and pertinent part of logs:
2018-03-26T03:05:29.4416011Z Downloading artifacts from: https://rpm1984.visualstudio.com//_apis/resources/Containers/1753137?itemPath=drop&isShallow=true&api-version=4.1-preview.4
2018-03-26T03:05:29.6204337Z Downloading drop/RedditSentimentAnalyzer.1.0.0-CI-20180322-025919.nupkg to D:\a\r1\a\Master CI\drop\RedditSentimentAnalyzer.1.0.0-CI-20180322-025919.nupkg
2018-03-26T03:05:29.6248792Z Downloaded drop/RedditSentimentAnalyzer.1.0.0-CI-20180322-025919.nupkg to D:\a\r1\a\Master CI\drop\RedditSentimentAnalyzer.1.0.0-CI-20180322-025919.nupkg
2018-03-26T03:05:30.4524266Z Total Files: 1, Processed: 1, Skipped: 0, Failed: 0, Download time: 1.007 secs, Download size: 10227Bytes
2018-03-26T03:05:30.5070857Z Successfully downloaded artifacts to D:\a\r1\a/Master CI
2018-03-26T03:05:30.5101258Z ##[section]Finishing: Download artifact - Master CI
...
2018-03-26T03:05:30.5119489Z ##[section]Starting: Use NuGet 4.3.0
2018-03-26T03:05:30.5122745Z ==============================================================================
2018-03-26T03:05:30.5122980Z Task : NuGet Tool Installer
2018-03-26T03:05:30.5123255Z Description : Acquires a specific version of NuGet from the internet or the tools cache and adds it to the PATH. Use this step to change the version of NuGet used in the NuGet steps.
2018-03-26T03:05:30.5123505Z Version : 0.1.5
2018-03-26T03:05:30.5123696Z Author : Microsoft Corporation
2018-03-26T03:05:30.5123904Z Help : [More Information](https://go.microsoft.com/fwlink/?linkid=852538)
2018-03-26T03:05:30.5124656Z ==============================================================================
2018-03-26T03:05:31.7510971Z Downloading: https://dist.nuget.org/win-x86-commandline/v4.3.0/nuget.exe
2018-03-26T03:05:31.8479515Z Caching tool: NuGet 4.3.0 x64
2018-03-26T03:05:31.8600552Z Using version: 4.3.0
2018-03-26T03:05:31.8602827Z Found tool in cache: NuGet 4.3.0 x64
2018-03-26T03:05:31.8603258Z Using tool path: D:\a\_tool\NuGet\4.3.0\x64
2018-03-26T03:05:31.8605921Z Prepending PATH environment variable with directory: D:\a\_tool\NuGet\4.3.0\x64
2018-03-26T03:05:31.8723553Z ##[section]Finishing: Use NuGet 4.3.0
...
123456789101112
2018-03-26T03:05:31.8764514Z ##[section]Starting: Push artifact to NuGet2018-03-26T03:05:31.8770703Z ==============================================================================2018-03-26T03:05:31.8770932Z Task : NuGet2018-03-26T03:05:31.8771244Z Description : Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Package Management and MyGet. Uses NuGet.exe and works with .NET Framework apps. For .NET Core and .NET Standard apps, use the .NET Core task.2018-03-26T03:05:31.8771593Z Version : 2.0.242018-03-26T03:05:31.8771774Z Author : Microsoft Corporation2018-03-26T03:05:31.8772001Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613747)2018-03-26T03:05:31.8772231Z ==============================================================================2018-03-26T03:05:33.2855694Z [command]C:\Windows\system32\chcp.com 650012018-03-26T03:05:33.3914203Z Active code page: 650012018-03-26T03:05:33.4169477Z ##[section]Finishing: Push artifact to NuGet
2018-03-26T03:05:31.8764514Z ##[section]Starting: Push artifact to NuGet
2018-03-26T03:05:31.8770703Z ==============================================================================
2018-03-26T03:05:31.8770932Z Task : NuGet
2018-03-26T03:05:31.8771244Z Description : Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Package Management and MyGet. Uses NuGet.exe and works with .NET Framework apps. For .NET Core and .NET Standard a
Find
No Results
```
You can use Nuget task and choose push command:

VSTS Release Task - Push to Nuget

I'm trying to set up CI for my Core projects and wrappers to our vsts nuget feed.
I've followed the Zen of Package Management tutorial here.
It's a little out of date, but I believe I managed to translate the changes.
My Build seems to work fine, it builds and packages the dll's into several nuget packages.
The release seems to work also, but the Nuget Feed is not updated with the latest packages.
My Release task is only one task as shown in the image below.
The log shows that it found and downloaded the packages, but it does not show any success on the actual push to nuget.
This is the log that shows the packages being found, and successful completion.
2017-11-15T02:40:59.5675003Z ##[section]Finishing: Initialize Job
2017-11-15T02:40:59.6125167Z ##[section]Starting: Download Artifacts
2017-11-15T02:41:00.2861639Z Downloading artifact
2017-11-15T02:41:00.2961643Z Creating artifacts directory: d:\a\r1\a
...etc
2017-11-15T02:41:00.8313684Z Downloading file d:\a\r1\a\Satalyst-Visual Studio-CI\drop\release\Packaged\Satalyst.AzureWrapper.Domain.2.0.0.3.nupkg
2017-11-15T02:41:00.9943663Z Downloading file d:\a\r1\a\Satalyst-Visual Studio-CI\drop\release\Packaged\Satalyst.PaymentGateway.Interfaces.2.0.0.3.nupkg
2017-11-15T02:41:00.9998063Z Downloading file d:\a\r1\a\Satalyst-Visual Studio-CI\drop\release\Packaged\Satalyst.PaymentGateway.Test.2.0.0.3.nupkg
...etc
2017-11-15T02:41:01.0750176Z Download complete.
2017-11-15T02:41:01.0761342Z 16 placed file(s): 16 downloaded, 0 empty
2017-11-15T02:41:01.0830178Z 1 MB downloaded at 1491 KB/sec. Download time: 00:00:00.2761869.
2017-11-15T02:41:01.0830178Z Downloaded linked artifact Satalyst-Visual Studio-CI
2017-11-15T02:41:01.0830178Z Finished artifacts download
2017-11-15T02:41:01.0890187Z ##[section]Finishing: Download Artifacts
... its this bit below that succeeds, but the feed does not show the new packages??
2017-11-15T02:41:01.0920188Z ##[section]Starting: NuGet Publish
2017-11-15T02:41:01.1190170Z ==============================================================================
2017-11-15T02:41:01.1190170Z Task : NuGet
2017-11-15T02:41:01.1190170Z Description : Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Package Management and MyGet. Uses NuGet.exe and works with .NET Framework apps. For .NET Core and .NET Standard apps, use the .NET Core task.
2017-11-15T02:41:01.1190170Z Version : 2.0.15
2017-11-15T02:41:01.1190170Z Author : Microsoft Corporation
2017-11-15T02:41:01.1190170Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613747)
2017-11-15T02:41:01.1190170Z ==============================================================================
2017-11-15T02:41:04.1372760Z Caching tool: NuGet 4.1.0 x64
2017-11-15T02:41:04.1502760Z Found tool in cache: NuGet 4.1.0 x64
2017-11-15T02:41:04.1612765Z Resolved from tool cache: 4.1.0
2017-11-15T02:41:04.1612765Z Using version: 4.1.0
2017-11-15T02:41:04.1612765Z Found tool in cache: NuGet 4.1.0 x64
2017-11-15T02:41:05.1667858Z [command]C:\Windows\system32\chcp.com 65001
2017-11-15T02:41:05.1667858Z Active code page: 65001
2017-11-15T02:41:05.1877908Z ##[section]Finishing: NuGet Publish
2017-11-15T02:41:05.1937859Z ##[section]Finishing: Release
Any assistance would be greatly appreciated, I've been doing a bit of trial and error to find the issue with no success. I'm now a bit stuck with no error messages and no feedback on the outcome for the push.
It's caused by the configuration of Path to NuGet package(s) to publish option for NuGet Push task in your release definition.
Please change the Path to NuGet package(s) to publish as:
$(System.DefaultWorkingDirectory)/**/packed/*.nupkg
Then the nuget package should be published to your feed correctly.

Visual Studio Team Services ASPNET CORE build failure

I'm trying to setup a build definition for a new ASPNET Core webapp.
The setup of the build definition is exactly this:
Official Docs
The build fails at building the solution with this error:
Issues
Build
File name doesn't indicate a full path to a executable file.
GETSDKTOOLINGINFO (0, 0)
The project is configured to use .NET Core SDK version 1.0.0-preview2-003131 which is not installed or cannot be found under the path C:\Program Files\dotnet. These components are required to build and run this project. Download the version of .NET Core SDK specified in global.json or update the SDK version in global.json to the version that is installed.
Process 'msbuild.exe' exited with code '1'.
Any guess on how to solve this?
Thanks
Francesco
You need to install the corresponding version of .Net SDK to build agent machine.
You can refer to this article to download .Net Core 1.0.0-preview2-003131 and install it on your build machine.
Assuming you are using hosted build agent. According to Software on the hosted build server, the hosted build server is deployed with the following .NET Framework:
.NET 4.6
.NET 4.5.2
.NET 4.5.1
.NET 4.5
.NET 3.5 SP1
.NET Core 1.0 with Preview 2 Tooling
You may try to deploy an on-premises build agent and install .NET Core 1.0.1 SDK 1.0.0-preview2-003131 to work with VSTS: https://www.visualstudio.com/en-us/docs/build/admin/index#deploy_agent.
If you insist on using hosted build agent, then you need to use version of Microsoft.NETCore.App that is installed in VSTS, for example:
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-rc2-3002702",
"type": "platform"
},
In my case, it was just a change in global.config:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-preview2-003121"
}
}
As long as 1.0.0-preview2-003131 is not available on VSO build hosts