Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Nuget restore fails on Windows runner

Zahid Çakıcı May 4, 2023

I have a Bitbucket pipeline running on self-hosted windows runner.

pipelines:
  default:
    - step:
        name: Build and test
        runs-on:
          - "windows"
        script:
          - nuget.exe restore .\MyProject.sln -source "https://api.nuget.org/v3/index.json;http://nuget.mycompany.com/nuget"
          - msbuild .\MyProject.sln 

 But I get this error:

...
...
...
Adding package 'System.ValueTuple.4.5.0' to folder 'C:\Windows\system32\atlassian-bitbucket-pipelines-runner\temp\200c6e7a-b2bb-52a1-93a4-59b520d83266\1682613154669\build\packages' Restoring NuGet package WebGrease.1.6.0. Adding package 'WebGrease.1.6.0' to folder 'C:\Windows\system32\atlassian-bitbucket-pipelines-runner\temp\200c6e7a-b2bb-52a1-93a4-59b520d83266\1682613154669\build\packages' Errors in packages.config projects Could not find a part of the path 'C:\Windows\system32\atlassian-bitbucket-pipelines-runner\temp\200c6e7a-b2bb-52a1-93a4-59b520d83266\1682613154669\build\packages\Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.2.11.0\build\Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.targets'. Could not find a part of the path 'C:\Windows\system32\atlassian-bitbucket-pipelines-runner\temp\200c6e7a-b2bb-52a1-93a4-59b520d83266\1682613154669\build\packages\Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.2.11.0\build\Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.targets'. NuGet Config files used: C:\Windows\system32\atlassian-bitbucket-pipelines-runner\temp\200c6e7a-b2bb-52a1-93a4-59b520d83266\1682613154669\build\NuGet.Config C:\Users\myPc\AppData\Roaming\NuGet\NuGet.Config C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config Feeds used: C:\Users\myPc\.nuget\packages\ https://api.nuget.org/v3/index.json http://nuget.mycompany.com/nuget Installed: 33 package(s) to packages.config projects



1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 5, 2023

Hi Zahid,

Windows Runners use PowerShell to run pipeline steps on your Windows machine (host device). This error may be related to the configuration of your project or it may be a bug with NuGet. For example, I found this issue here in the issue tracker of NuGet, where a similar error is reported:

I would suggest checking the details and suggestions in that issue, in case the error you get is related to that. Otherwise, the ReadMe of the NuGet repo suggests asking any questions related to Nuget on Stack Overflow.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events