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

[Bug]: [Cross-platform Sign Verify] A redundant “error: Value cannot be null” shows after running command “dotnet add package” on Windows #12039

Closed
v-luzh opened this issue Aug 18, 2022 · 1 comment
Labels
Found:ManualTests Resolution:Duplicate This issue appears to be a Duplicate of another issue Type:Bug

Comments

@v-luzh
Copy link

v-luzh commented Aug 18, 2022

NuGet Product Used

dotnet.exe

Product Version

.NET SDK Version: 7.0.100-rc.2.22417.1

Worked before?

No response

Impact

It bothers me. A fix would be nice

Repro Steps & Context

Details about Problem

.NET SDK Version: 7.0.100-rc.2.22417.1

Detailed repro steps

  1. Execute the Pre-testing steps.
  2. Where and are datetime values that mark a 10-minute period starting now, create a short-lived test code signing certificate that will expire 10 minutes from now.
    On Windows: .\dotnet\dotnet run --project .\Entropy\MakeTestCert\MakeTestCert.csproj --framework net7.0 -- -nb "<NotBefore>" -na "<NotAfter>"
  3. Where is the file path to the .cer or .pem file in step 1 and is the directory path for the versioned .NET SDK directory (e.g.: ./dotnet/dotnet/sdk/7.0.100), add trust for the certificate:
    On Windows: .\dotnet\dotnet run --project .\Entropy\TrustTestCert\TrustTestCert.csproj --framework net7.0 -- add -c <CertificateFilePath>
  4. Where is the test package ID and is the file path to the .pfx file, sign the test package:
    On Windows: .\dotnet\dotnet nuget sign .\<PackageId>\bin\Debug\<PackageId>.1.0.0.nupkg --overwrite --certificate-path <PfxFilePath>
  5. Verify that 1 warning displays in the output from the previous step:
    warn : NU3002: The '--timestamper' option was not provided. The signed package will not be timestamped. To learn more about this option, please visit https://docs.microsoft.com/dotnet/core/tools
  6. Create a test project:
    On Windows: mkdir .\test && pushd .\test && ..\dotnet\dotnet new console && copy ..\NuGet.config.template .\NuGet.config
  7. Update NuGet.config to reference the SHA-256 fingerprint of the short-lived certificate created in step 2.
  8. Clear local NuGet resources and previous restore results:
    On Windows: rd /s /q .\obj && ..\dotnet\dotnet nuget locals --clear all
  9. Where is the test package ID, add a package reference to the test package:
    On Windows: ..\dotnet\dotnet add package <PackageId> --version 1.0.0

Expected

No redundant “error: Value cannot be null” shows.

Actual

A redundant “error: Value cannot be null” shows after running command “dotnet add package” on Windows as below.
image

Verbose Logs

No response

@nkolev92
Copy link
Member

Dup of #8543.

I think this is unrelated to signing

@nkolev92 nkolev92 added the Resolution:Duplicate This issue appears to be a Duplicate of another issue label Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Found:ManualTests Resolution:Duplicate This issue appears to be a Duplicate of another issue Type:Bug
Projects
None yet
Development

No branches or pull requests

3 participants