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

Unable to install any dotnet tool #30961

Closed
sandrohanea opened this issue Mar 2, 2023 · 4 comments
Closed

Unable to install any dotnet tool #30961

sandrohanea opened this issue Mar 2, 2023 · 4 comments
Assignees

Comments

@sandrohanea
Copy link
Member

Describe the bug

Similar to some issues described in the comments of: #10295 which is now closed, I'm receiving NU1211 and NU1212 if I try to install any dotnet tool.

Exceptions (if any)

Started to reproduce after some update of VS 2022 preview which included update of dotnet.
I executed dotnet tool install --global dotnet-ef -v diag --no-cache and here is the result:
dotnetlog-diag.log

Further technical details

Dotnet info:
`C:\Users\sandro>dotnet --info
.NET SDK:
Version: 7.0.200
Commit: 5341177

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22621
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\7.0.200\

Host:
Version: 7.0.3
Architecture: x64
Commit: 0a2bda10e8

.NET SDKs installed:
3.1.426 [C:\Program Files\dotnet\sdk]
6.0.309 [C:\Program Files\dotnet\sdk]
7.0.103 [C:\Program Files\dotnet\sdk]
7.0.200 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download`

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Tools untriaged Request triage from a team member labels Mar 2, 2023
@nagilson nagilson removed the untriaged Request triage from a team member label Mar 9, 2023
@nagilson
Copy link
Member

Fairly certain this is because the Directory.Build.Props file in your C: users folder has an invalid package reference hence the nuget errors. Thanks to @baronfel for diagnosing this with me. Maybe we could handle this better though and call the nuget apis instead of what we currently do on to restore the fake tool project.

@baronfel
Copy link
Member

This failure mode is described here, and is part of our all-up set of fixes for the .NET 8 time frame (which is tracked here).

@sandrohanea
Copy link
Member Author

Thanks for the investigation, I confirm there was a Directory.Build.props file in my user folder (even though I don’t recall adding it myself). I removed the file and now any dotnet tool is installing as expected.

@sandrohanea
Copy link
Member Author

This was the content of the file:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <PackageReference Include="Packaging.Targets">
      <Version>0.1.220-*</Version>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
  </ItemGroup>
</Project>

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