KeyNotFoundException with 2.8.0
See original GitHub issueAfter 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:
- Created 3 months ago
- Reactions:27
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
seeing the same issue
version 2.7.0 does not have this problem
I adjusted the PR to also cover those. Please be aware, that the
net48
should contain atargetAlias
to be valid pointing to.NETFramework,Version=v4.8
as used target.