Closed dave0783 closed 7 months ago
Any updates on this?
I was getting the same issue and was able to find a workaround.
I had two <TargetFrameworks>...</TargetFrameworks>
lines, and one of them had a condition <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
, by removing the condition it started working without any errors.
I'm not sure but the issue might be in lib/nuget-parser/csproj-parser.ts
where propertyGroup?.TargetFrameworks?.[0]
appears to be reading only the first value of TargetFrameworks
which I would guess it's the condition (which is not a string probably).
@dave0783 @Aandree5 could you try running this with our new beta solution? snyk monitor --all-projects --dotnet-runtime-resolution
and see if this gives you better results?
node -v
: v20.3.0npm -v
: 9.6.7snyk -v
: 1.1183.0snyk monitor --all-projects
https://github.com/snyk/snyk-nuget-plugin/blob/f433837303b7fedb769e46a12dcb81e4d362d34f/lib/nuget-parser/csproj-parser.ts#L44
When running monitor I am getting
targetFrameworkSource.split is not a function
.our .csproj files looks something like: