Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KeyNotFoundException with 2.8.0

See original GitHub issue

After updating to 2.8.0, I can not use CycloneDX anymore… This has not happened with 2.7.0.

Unhandled exception. System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Text.Json.JsonElement.GetProperty(String propertyName)
   at CycloneDX.Services.ProjectAssetsFileService.SetIsDevDependency(String packageName, String targetRuntime, JsonElement jsonContent) in /home/runner/work/cyclonedx-dotnet/cyclonedx-dotnet/CycloneDX/Services/ProjectAssetsFileService.cs:line 113
   at CycloneDX.Services.ProjectAssetsFileService.GetNugetPackages(String projectFilePath, String projectAssetsFilePath, Boolean isTestProject, Boolean excludeDev) in /home/runner/work/cyclonedx-dotnet/cyclonedx-dotnet/CycloneDX/Services/ProjectAssetsFileService.cs:line 63
   at CycloneDX.Services.ProjectFileService.GetProjectNugetPackagesAsync(String projectFilePath, String baseIntermediateOutputPath, Boolean excludeTestProjects, Boolean excludeDev, String framework, String runtime) in /home/runner/work/cyclonedx-dotnet/cyclonedx-dotnet/CycloneDX/Services/ProjectFileService.cs:line 145
   at CycloneDX.Program.OnExecuteAsync(CommandLineApplication app) in /home/runner/work/cyclonedx-dotnet/cyclonedx-dotnet/CycloneDX/Program.cs:line 255
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.InvokeAsync(MethodInfo method, Object instance, Object[] arguments)
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.OnExecute(ConventionContext context, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.<>c__DisplayClass0_0.<<Apply>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync[TApp](CommandLineContext context, CancellationToken cancellationToken)
   at CycloneDX.Program.Main(String[] args) in /home/runner/work/cyclonedx-dotnet/cyclonedx-dotnet/CycloneDX/Program.cs:line 140
   at CycloneDX.Program.<Main>(String[] args)

Issue Analytics

  • State:closed
  • Created 3 months ago
  • Reactions:27
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

stand-surecommented, Jun 21, 2023

seeing the same issue

version 2.7.0 does not have this problem

Falco20019commented, Jun 28, 2023

I adjusted the PR to also cover those. Please be aware, that the net48 should contain a targetAlias to be valid pointing to .NETFramework,Version=v4.8 as used target.

Read more comments on GitHub >

github_iconTop Results From Across the Web

KeyNotFoundException Class (System.Collections.Generic)
A KeyNotFoundException is thrown when an operation attempts to retrieve an element from a collection using a key that does not exist in...
Read more >
Unhandled Exception: System.Collections.Generic. ...
KeyNotFoundException: The given key was not present in the dictionary. untitled. And the main problem is that all puppeteer sharp code running ...
Read more >
c# - Best way to handle a KeyNotFoundException
I run a bunch of keys through the dictionary, and I expect some keys to not have a value. I catch the KeyNotFoundException...
Read more >
the given key 'string team' was not present in the dictionary.
Unhandled exception. System.collections.generic.keynotfoundexception: the given key 'string team' was not present in the dictionary.
Read more >
The given key was not present in the dictionary.
When I add one more entry into title data like data.Add(GemsKey, "2"); It gives error: KeyNotFoundException: The given key was not present in ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found