Open bennati opened 5 months ago
@bennati Thanks for the report... I reckon you were working on a checkout of https://github.com/google/googletest/ ... correct? Also can tell what is your OS/OS version, CPU architecture and version of the dotnet framework installed?
Yes, I downloaded that file locally and ran nuget instpector on it. It's running on x86_64 linux (dockerized), dotnet version 6.0.418
My workaround for this kind of error is to edit the csproj/vcxproj file and add a Condition to check if the file exists.
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" Condition="exists('$(VCTargetsPath)\Microsoft.Cpp.Default.props')" />
@pombredanne: I think we need a more robust approach here, like providing a flag to ignore missing imports.
Other examples are: https://stackoverflow.com/questions/14640045/wcf-compilation-error-on-ci-server-microsoft-visualstudio-servicemodel-targets
@mawl re:
I think we need a more robust approach here, like providing a flag to ignore missing imports.
This could work, and how would spec this?
You realize though that this would mean that we are missing files and that the dependency resolution ends up being a best effort, more than likely incorrect, because the project would not even compile and build for real in this configuration.
@pombredanne: thanks for your answer. Let me explain: We're using ORT which uses the nuget-inspector.
We experience some issues during analyze phase when these imports are missing and often these projects doesn't even have NuGet PackageReferences.
Actually we're using ORTs mechanism of issue resolution to ignore them: https://oss-review-toolkit.org/ort/docs/configuration/ort-yml#resolving-issues
Maybe you have an idea how to deal with it?
Analyzing this file https://github.com/google/googletest/blob/0a439623f75c029912728d80cb7f1b8b48739ca4/googlemock/msvc/2010/gmock.vcxproj with nuget-inspector 0.9.12 with command
nuget-inspector --with-details --verbose --project-file gmock.vcxproj --json o.json
fails with the below stack trace