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

Unsupported project types are included in the processing if they are referenced from a supported project type. #896

Open
petercullen68 opened this issue Jul 24, 2024 · 5 comments
Labels
bug Something isn't working ready for development Issue is sufficiently defined and suitable for contributors to start working

Comments

@petercullen68
Copy link

petercullen68 commented Jul 24, 2024

We have a .sln that contains a mixture of .csproj and .vcxproj. The initial prcocessing in GetSolutionProjectReferencesAsync correctly removed invalid projects calling Utils.IsSupportedProjectType.

However the code just below this then loops through the valid projects and calls _projectFileService.RecursivelyGetProjectReferencesAsync to return a list of project references. It does not filter these references using Utils.IsSupportedProjectType. In my case this causes the program to crash attempting to process a .vcxproj.

@github-actions github-actions bot added the triage Don't know what to do with this yet label Jul 24, 2024
@jwfx
Copy link

jwfx commented Jul 30, 2024

What error messages are you getting?

@mtsfoni
Copy link
Contributor

mtsfoni commented Jul 30, 2024

Should work till version 2.10

I will have a look soon, shouldn't be a big issue to fix

@mtsfoni mtsfoni added bug Something isn't working ready for development Issue is sufficiently defined and suitable for contributors to start working and removed triage Don't know what to do with this yet labels Jul 30, 2024
@petercullen68
Copy link
Author

@mtsfoni Thank you. My quick fix to test was this (in RecursivelyGetProjectReferencesAsync)

            while (files.Count > 0)
            {
                var currentFile = files.Dequeue();

                if (!Utils.IsSupportedProjectType(currentFile))
                {
                    continue;
                }

@petercullen68
Copy link
Author

@jwfx The app attempts to process a C++ nuget package from the .vcxproj and throws an error trying to process it.

petercullen68 added a commit to petercullen68/cyclonedx-dotnet that referenced this issue Sep 4, 2024
A fix for CycloneDX#896.  When processing recursively through projects, apply the
supported project test and skip any projects that do no satisfy the test
Applied at release 3.0.8
petercullen68 added a commit to petercullen68/cyclonedx-dotnet that referenced this issue Sep 4, 2024
A fix for CycloneDX#896.  When processing recursively through projects, apply the
supported project test and skip any projects that do no satisfy the test
Applied at release 3.0.8

Signed-off-by: Peter Cullen <[email protected]>
petercullen68 added a commit to petercullen68/cyclonedx-dotnet that referenced this issue Sep 10, 2024
A fix for CycloneDX#896.  When processing recursively through projects, apply the
supported project test and skip any projects that do no satisfy the test

Signed-off-by: Peter Cullen <[email protected]>
@petercullen68
Copy link
Author

I have opened a pull request to fix this. It has been tested and works in my case.

petercullen68 added a commit to petercullen68/cyclonedx-dotnet that referenced this issue Sep 20, 2024
A fix for CycloneDX#896.  When processing recursively through projects, apply the
supported project test and skip any projects that do no satisfy the test
Applied at release 3.0.8

Signed-off-by: Peter Cullen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready for development Issue is sufficiently defined and suitable for contributors to start working
Projects
None yet
Development

No branches or pull requests

3 participants