Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet build -v diag does not provide enough diagnostics about Nuget restore #18048

Closed
msfcolombo opened this issue Jun 3, 2021 · 4 comments
Closed
Milestone

Comments

@msfcolombo
Copy link

According to the build log below, the dotnet build command is trying to access project C:\Users\johns\AppData\Local\Temp\NuGetScratch\57ff535248c742eb9fd7acaa4cedc232\118c797d4f8849aca719bca50f33ee45.proj and Nuget feed https://pkgs.dev.contoso.org/feedproj/fe545156-aa3d-6d2c-1209-a4ed12782004/_packaging/mainfeed02.

I have absolutely no idea from where it is taking these values. The current directory has no reference to the proj above, and the nuget.config has no reference to the feed above.

I have searched the following places:

  • The nuget.config of current directory and all parent directories.
  • The %appdata%\NuGet\NuGet.Config.
  • The global.json file in current directory.

If I install any package on same directory, running nuget install -verbosity detailed newtonsoft.json -version 6.0.1, it uses the correct feed. It does not even mention the wrong feed.

The log below was generated with dotnet build -v diag. How am I supposed to diagnose this if the log does not include the configuration files and/or environment variables used to determine the restore locatioons?

APPDATA = C:\Users\johns\AppData\Roaming
ChocolateyInstall = C:\ProgramData\chocolatey
ChocolateyLastPathUpdate = 132438271807371023
ChocolateyToolsLocation = C:\tools
CommonProgramFiles = C:\Program Files\Common Files
CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files
CommonProgramW6432 = C:\Program Files\Common Files
COMPUTERNAME = JOHNS-TWO
ComSpec = C:\WINDOWS\system32\cmd.exe
DOTNET_CLI_TELEMETRY_SESSIONID = <redacted>
DOTNET_HOST_PATH = C:\Program Files\dotnet\dotnet.exe
DriverData = C:\Windows\System32\Drivers\DriverData
GOPATH = D:\projects\go
HOMEDRIVE = C:
HOMEPATH = \Users\johns
LOCALAPPDATA = C:\Users\johns\AppData\Local
LOGONSERVER = \\MANAC-WELSEE-08
MSBuildExtensionsPath = C:\Program Files\dotnet\sdk\5.0.203\
MSBuildLoadMicrosoftTargetsReadOnly = true
MSBuildSDKsPath = C:\Program Files\dotnet\sdk\5.0.203\Sdks
NugetMachineInstallRoot = D:\nuget-cache
NUMBER_OF_PROCESSORS = 8
OneDrive = C:\Users\johns\OneDrive - Microsoft
OneDriveCommercial = C:\Users\johns\OneDrive - Microsoft
OneDriveConsumer = C:\Users\johns\OneDrive
OS = Windows_NT
Path = C:\Program Files\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files (x86)\Common Files\Microsoft Shared\Microsoft Online Services;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;C:\Users\johns\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Git\bin;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\GitExtensions\;C:\Program Files\nodejs\;C:\Program Files\dotnet\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\dotnet\;D:\go\bin;C:\Program Files\PuTTY\;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Users\johns\AppData\Local\bin\NASM;;C:\Program Files\Azure Data Studio\bin;C:\Users\johns\scoop\shims;C:\Users\johns\AppData\Roaming\npm;C:\Users\johns\.dotnet\tools;C:\Users\johns\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\johns\go\bin;C:\Users\johns\.dotnet\tools
PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE = AMD64
PROCESSOR_IDENTIFIER = Intel64 Family 6 Model 158 Stepping 13, GenuineIntel
PROCESSOR_LEVEL = 6
PROCESSOR_REVISION = 9e0d
ProgramData = C:\ProgramData
ProgramFiles = C:\Program Files
ProgramFiles(x86) = C:\Program Files (x86)
ProgramW6432 = C:\Program Files
PROMPT = $P$G
PSModulePath = C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\Microsoft Azure Information Protection\Powershell
PUBLIC = C:\Users\Public
SystemDrive = C:
SystemRoot = C:\WINDOWS
TEMP = C:\Users\johns\AppData\Local\Temp
TMP = C:\Users\johns\AppData\Local\Temp
UATDATA = C:\Windows\CCM\UATData\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77
USERDNSDOMAIN = MARYSVILLE.CONTOSO.ORG
USERDOMAIN = MARYSVILLE
USERDOMAIN_ROAMINGPROFILE = MARYSVILLE
USERNAME = johns
USERPROFILE = C:\Users\johns
windir = C:\WINDOWS

17:19:48.892     0>Process = "C:\Program Files\dotnet\dotnet.exe"
                   MSBuild executable path = "C:\Program Files\dotnet\sdk\5.0.203\MSBuild.dll"
                   Command line arguments = ""C:\Program Files\dotnet\sdk\5.0.203\MSBuild.dll" -maxcpucount -verbosity:m -restore -consoleloggerparameters:Summary -verbosity:diag "-distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\5.0.203\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\5.0.203\dotnet.dll""
                   Current directory = "D:\source\Mark3"
                   MSBuild version = "16.9.0+57a23d249"
                   Resolving SDK 'Microsoft.Build.Traversal'...
                   Running restore with 8 concurrent jobs.
                   Reading project file C:\Users\johns\AppData\Local\Temp\NuGetScratch\57ff535248c742eb9fd7acaa4cedc232\118c797d4f8849aca719bca50f33ee45.proj.
                   Restoring packages for C:\Users\johns\AppData\Local\Temp\NuGetScratch\57ff535248c742eb9fd7acaa4cedc232\118c797d4f8849aca719bca50f33ee45.proj...
                   Restoring packages for .NETStandard,Version=v0.0...
                     GET https://pkgs.dev.contoso.org/feedproj/fe545156-aa3d-6d2c-1209-a4ed12782004/_packaging/mainfeed02/nuget/v3/flat2/microsoft.build.traversal/index.json
                     Unauthorized https://pkgs.dev.contoso.org/feedproj/fe545156-aa3d-6d2c-1209-a4ed12782004/_packaging/mainfeed02/nuget/v3/flat2/microsoft.build.traversal/index.json 254ms
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Jun 3, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@sfoslund sfoslund added Area-NuGet and removed untriaged Request triage from a team member labels Jun 9, 2021
@sfoslund sfoslund removed their assignment Jun 9, 2021
@sfoslund sfoslund added this to the Discussion milestone Jun 9, 2021
@sfoslund
Copy link
Member

sfoslund commented Jun 9, 2021

@msfcolombo you can try using a binlog to investigate. @nkolev92 are there any nuget specific logging methods that can be looked at here?

@nkolev92
Copy link
Contributor

nkolev92 commented Jun 9, 2021

It seems like the failure is coming from the MSBuild nuget SDK resolver. It's using a "fake" project, hence name with guids.

It seems like it's loading all configs above the project file path that is declaring the SDK: microsoft.build.traversal

https://github.com/NuGet/NuGet.Client/blob/7950d9b3c0b7fb9dc1c55700dc00e86e1ebd82f2/src/NuGet.Core/Microsoft.Build.NuGetSdkResolver/NuGetSdkResolver.cs#L124.

So I'd look for a config above project that's declaring that SDK.

@ghost
Copy link

ghost commented Apr 21, 2022

Thanks for creating this issue! We believe this issue is related to NuGet tooling, which is maintained by the NuGet team. Thus, we closed this one and encourage you to raise this issue in the NuGet repository instead. Don’t forget to check out NuGet’s contributing guide before submitting an issue!

If you believe this issue was closed out of error, please comment to let us know.

Happy Coding!

@ghost ghost closed this as completed Apr 21, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants